{"raw_statement":[{"iden":"problem statement","content":"Takahashi has two sheets $A$ and $B$, each composed of black squares and transparent squares, and an infinitely large sheet $C$ composed of transparent squares.  \nThere is also an ideal sheet $X$ for Takahashi composed of black squares and transparent squares.\nThe sizes of sheets $A$, $B$, and $X$ are $H_A$ rows $\\times$ $W_A$ columns, $H_B$ rows $\\times$ $W_B$ columns, and $H_X$ rows $\\times$ $W_X$ columns, respectively.  \nThe squares of sheet $A$ are represented by $H_A$ strings of length $W_A$, $A_1, A_2, \\ldots, A_{H_A}$ consisting of `.` and `#`.  \nIf the $j$\\-th character $(1\\leq j\\leq W_A)$ of $A_i$ $(1\\leq i\\leq H_A)$ is `.`, the square at the $i$\\-th row from the top and $j$\\-th column from the left is transparent; if it is `#`, that square is black.  \nSimilarly, the squares of sheets $B$ and $X$ are represented by $H_B$ strings of length $W_B$, $B_1, B_2, \\ldots, B_{H_B}$, and $H_X$ strings of length $W_X$, $X_1, X_2, \\ldots, X_{H_X}$, respectively.\nTakahashi's goal is to create sheet $X$ using **all black squares** in sheets $A$ and $B$ by following the steps below with sheets $A$, $B$, and $C$.\n\n1.  Paste sheets $A$ and $B$ onto sheet $C$ along the grid. Each sheet can be pasted anywhere by translating it, but it cannot be cut or rotated.\n2.  Cut out an $H_X\\times W_X$ area from sheet $C$ along the grid. Here, a square of the cut-out sheet will be black if a black square of sheet $A$ or $B$ is pasted there, and transparent otherwise.\n\nDetermine whether Takahashi can achieve his goal by appropriately choosing the positions where the sheets are pasted and the area to cut out, that is, whether he can satisfy both of the following conditions.\n\n*   The cut-out sheet includes **all black squares** of sheets $A$ and $B$. The black squares of sheets $A$ and $B$ may overlap on the cut-out sheet.\n*   The cut-out sheet coincides sheet $X$ without rotating or flipping."},{"iden":"constraints","content":"*   $1\\leq H_A, W_A, H_B, W_B, H_X, W_X\\leq 10$\n*   $H_A, W_A, H_B, W_B, H_X, W_X$ are integers.\n*   $A_i$ is a string of length $W_A$ consisting of `.` and `#`.\n*   $B_i$ is a string of length $W_B$ consisting of `.` and `#`.\n*   $X_i$ is a string of length $W_X$ consisting of `.` and `#`.\n*   Sheets $A$, $B$, and $X$ each contain at least one black square."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$H_A$ $W_A$\n$A_1$\n$A_2$\n$\\vdots$\n$A_{H_A}$\n$H_B$ $W_B$\n$B_1$\n$B_2$\n$\\vdots$\n$B_{H_B}$\n$H_X$ $W_X$\n$X_1$\n$X_2$\n$\\vdots$\n$X_{H_X}$"},{"iden":"sample input 1","content":"3 5\n#.#..\n.....\n.#...\n2 2\n#.\n.#\n5 3\n...\n#.#\n.#.\n.#.\n..."},{"iden":"sample output 1","content":"Yes\n\nFirst, paste sheet $A$ onto sheet $C$, as shown in the figure below.\n\n     $\\vdots$\n  .......  \n  .#.#...  \n$\\cdots$.......$\\cdots$\n  ..#....  \n  .......  \n     $\\vdots$\n\nNext, paste sheet $B$ so that its top-left corner aligns with that of sheet $A$, as shown in the figure below.\n\n     $\\vdots$\n  .......  \n  .#.#...  \n$\\cdots$..#....$\\cdots$\n  ..#....  \n  .......  \n     $\\vdots$\n\nNow, cut out a $5\\times 3$ area with the square in the first row and second column of the range illustrated above as the top-left corner, as shown in the figure below.\n\n...\n#.#\n.#.\n.#.\n...\n\nThis includes all black squares of sheets $A$ and $B$ and matches sheet $X$, satisfying the conditions.\nTherefore, print `Yes`."},{"iden":"sample input 2","content":"2 2\n#.\n.#\n2 2\n#.\n.#\n2 2\n##\n##"},{"iden":"sample output 2","content":"No\n\nNote that sheets $A$ and $B$ may not be rotated or flipped when pasting them."},{"iden":"sample input 3","content":"1 1\n#\n1 2\n##\n1 1\n#"},{"iden":"sample output 3","content":"No\n\nNo matter how you paste or cut, you cannot cut out a sheet that includes all black squares of sheet $B$, so you cannot satisfy the first condition. Therefore, print `No`."},{"iden":"sample input 4","content":"3 3\n###\n...\n...\n3 3\n#..\n#..\n#..\n3 3\n..#\n..#\n###"},{"iden":"sample output 4","content":"Yes"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}