A balanced binary string is a binary string with an equal number of s and s. Given a string of length , output the number of subsequences of that are balanced binary strings, modulo .
A subsequence is defined as a sequence that can be derived from the string by deleting some or no elements. For this problem, an empty subset is not considered a subsequence.
Input Specification
The first line contains an integer, .
The second line contains a binary string, .
Output Specification
Output one integer, the number of subsequences of that are balanced binary strings, modulo .
Subtasks
Subtask 1 [10%]
Subtask 2 [90%]
Sample Input
5
10010
Sample Output
9
Comments