You are given a grid in which each cell consists of either 0 or 1. A cell is blocked if its value is 1. Standing at a cell , you can perform the following steps.
You are initially located at cell . Determine the number of ways in which you can reach starting from your initial location.
Since the answer can be large, print it modulo ().
Example: Let 3 * 3 grid be
0 | 1 | 0 |
1 | 0 | 0 |
0 | 0 | 0 |
If you are standing at cell (1,1), then:
The answer will be 2.
Input format
Output format
Print a single line containing the number of ways to reach from modulo .
Constraints
Each cell consists of either '0' or '1'.
There are 3 ways to reach (3,3) from (1,1).