Michael spends his summer holiday at his grandparents’ house, in the Danube Delta. On the first day, he goes fishing with his father to the place where he used to go every day during his childhood. Michael realises that the chosen route is not the only option for covering the distance from his grandparents’ house to the fishing place, so, once he has visited the entire region together with his grandfather, he wonders in how many distinct ways he can cover the distance from their home to the fishing place. The region that Michael knows has a rectangular shape, with the rows numbered from to and the columns numbered from to . The values represent areas of land and the values represent areas covered by water.
Michael can travel only by land and with the following restriction: from the area he can go only in one of the areas , , – obviously, only if there is land and he does not leave the region. Being an intelligent boy, when Michael visits the surroundings with his grandfather, he notices the following thing: the columns of the matrix which codifies the region are identically repeated every . Thus, the column , the column , the column , are identical. The column , the column , the column , are identical the column , the column , the column , are identical. Two columns and are identical if the element on the position is equal to the one on the position for all i from to .
Task
Knowing the coordinates of the place where the grandparents’ house lies and the coordinates of the fishing place that Michael’s father showed him, determine the number of options for covering the distance between them. Two routes are considered distinct if, by writing the sequences of the rows which are visited (in the increasing order of the columns) they differ at least in one position.
Input data
The first line will contain the numbers and (separated by a space), representing the number of rows of the region and the number with the signification mentioned above. On each of the following lines, there are numbers which can be or , not separated by spaces. On the line there are 2 numbers and (separated by a space) representing the coordinates of the fishing place. The grandparents’ house is considered .
Output data
The first line contains a single natural number, modulo .
Constraints and clarifications
- for of the tests
Example
stdin
4 3
111
011
110
111
1 4
stdout
4