The young light king likes toys. His favourite toy right now is an N×M rectangular board where a diagonal mirror can be pushed into any cell and pulled back out. He arranges the mirrors as he likes, then aims a laser at the centre of one border cell, perpendicular to that cell's outer side, and the laser comes back out of a different cell. He finds that fascinating.
He gave every border cell a positive integer number in the following way.
A corner cell touches the outside on two of its sides, so it receives two numbers. On a board with N=2 and M=3, for example, the three cells of the first row are 1, 2, 3 from the left, the two cells of the left column are 4, 5 from the top, the two cells of the right column are 6, 7 from the top, and the three cells of the last row are 8, 9, 10 from the left. The top left cell is both 1 and 4. A number also names the side the laser passes through. A laser fired at 1 enters the top left cell downward through its top side, and a laser fired at 4 enters the same cell rightward through its left side. Leaving at y means the laser crosses the side named by y and goes outside the board.
The king is interested in toys where a laser fired at x leaves at y. The mirror layout he wants is given as N strings of length M, and the characters mean the following.
/ : a mirror that reflects a laser arriving from the left to the top, one arriving from the top to the left, one arriving from the right to the bottom, and one arriving from the bottom to the right.\ : a mirror that reflects a laser arriving from the left to the bottom, one arriving from the top to the right, one arriving from the right to the top, and one arriving from the bottom to the left.. : a cell with no mirror, where the laser passes through undisturbed.? : a cell where any one of the three above is acceptable.The more ? cells there are, the more layouts can be built. Count how many of those layouts send a laser fired at x out at y.
The first line contains two integers N, M (1≤N,M≤8) giving the size of the board, then x, y (1≤x,y≤2(N+M)), separated by spaces.
Each of the next N lines contains a string of length M. Each string consists only of /, \, ., and ?.
The whole board contains at most 12 ? characters.
Print the number of layouts in which a laser fired at x leaves at y, modulo 10007.