Jumping Frog
There is a frog at position in a lake. The frog wants to get to position .
To do that, it can jump some number of times in the positive direction. For example, if , the frog could jump like this:
However, only some positions of the lake have lily pads, and the frog can only jump to positions with lily pads.
Additionally, each jump tires the frog, so the distance of the next jump has to be strictly less than the distance of the last jump.
For example, some valid sequences of jump distances are , and , while the sequence of jump distances is invalid, since it is not strictly decreasing.
Positions and have lily pads.
Your task is to count in how many ways the frog could get to position while satisfying the above rules.
Input
The first line of input contains a single integer ().
The second line contains a string of length , describing the lake. Each character is either . or L. If the -th character of the string is , it means position has a lily pad, otherwise it does not.
Output
Output a single integer: the number of ways the frog could get to position . Since this number may be large, output it modulo .
Samples
Sample 1
Input
5 ..L.
Output
2
There are two ways to get to : and .
Sample 2
Input
6 .....
Output
1
The only way is .