Stairs Again
There is a staircase of steps infront of you. You begin at step 1, and can jumps of sizes between
and
, or jumps of sizes between
and
. How many ways are there to reach step
.
Input
The first line of input contains space-seperated integers .
Output
The number of ways of getting from step to
, modulo
Constraints
Example 1
In
10 3 3 4 4
Out
1
Example 2
In
20 1 8 13 14
Out
256213
Comments