Grid Paths with Obstacles
Count the paths from the top-left to the bottom-right cell moving only right or down, avoiding cells marked 1. Print modulo .
Input
and , then rows of values (0 = free, 1 = blocked).
Output
The number of paths.
Constraints
Sample 1
Input
3 3 0 0 0 0 1 0 0 0 0
Output
2