The wizard Harry likes to bake.
One day, he found a spell that could transport him to the "backrooms" (this pun only works in Swedish), and he was filled with joy.
However, when he used the spell, he was not transported to a bakery, but to an infinitely large grid.
Each cell in the grid is either free or blocked.
In the grid, you can move up, down, left, or right to adjacent cells that are not blocked.
After walking around for a while, he notices that the pattern of blocked cells is periodic.
More precisely, there is an pattern that repeats infinitely.
See the figure below for exactly how this works.
:::align{center}
:::
To escape, he needs to reach a certain cell in the grid.
However, his teleportation magic is a bit rusty, so he will ask you questions of the form:
"If I teleport to cell , can I walk to cell ?"
输入格式
The first line contains two integers and (), the number of rows and columns of the grid.
The next lines each contain a string of length , consisting of the characters . and #.
These are the rows of the grid. The character # means the cell is blocked, and . means the cell is free.
After that follows a line with the integer (), the number of questions you must answer.
The following lines each contain four integers (), the coordinates of a question.
It is guaranteed that neither of the cells at these coordinates is blocked.
输出格式
For every question, print Yes if Harry can walk from cell to cell , otherwise print No.