{"raw_statement":[{"iden":"problem statement","content":"You are given $N$\\-by-$N$ matrices $A$ and $B$ where each element is $0$ or $1$.  \nLet $A_{i,j}$ and $B_{i,j}$ denote the element at the $i$\\-th row and $j$\\-th column of $A$ and $B$, respectively.  \nDetermine whether it is possible to rotate $A$ so that $B_{i,j} = 1$ for every pair of integers $(i, j)$ such that $A_{i,j} = 1$.  \nHere, to rotate $A$ is to perform the following operation zero or more times:\n\n*   for every pair of integers $(i, j)$ such that $1 \\leq i, j \\leq N$, simultaneously replace $A_{i,j}$ with $A_{N + 1 - j,i}$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 100$\n*   Each element of $A$ and $B$ is $0$ or $1$.\n*   All values in the input are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$A_{1,1}$ $A_{1,2}$ $\\ldots$ $A_{1,N}$\n$\\vdots$\n$A_{N,1}$ $A_{N,2}$ $\\ldots$ $A_{N,N}$\n$B_{1,1}$ $B_{1,2}$ $\\ldots$ $B_{1,N}$\n$\\vdots$\n$B_{N,1}$ $B_{N,2}$ $\\ldots$ $B_{N,N}$"},{"iden":"sample input 1","content":"3\n0 1 1\n1 0 0\n0 1 0\n1 1 0\n0 0 1\n1 1 1"},{"iden":"sample output 1","content":"Yes\n\nInitially, $A$ is :\n\n0 1 1\n1 0 0\n0 1 0\n\nAfter performing the operation once, $A$ is :\n\n0 1 0\n1 0 1 \n0 0 1\n\nAfter performing the operation once again, $A$ is :\n\n0 1 0\n0 0 1\n1 1 0\n\nHere, $B_{i,j} = 1$ for every pair of integers $(i, j)$ such that $A_{i,j} = 1$, so you should print `Yes`."},{"iden":"sample input 2","content":"2\n0 0\n0 0\n1 1\n1 1"},{"iden":"sample output 2","content":"Yes"},{"iden":"sample input 3","content":"5\n0 0 1 1 0\n1 0 0 1 0\n0 0 1 0 1\n0 1 0 1 0\n0 1 0 0 1\n1 1 0 0 1\n0 1 1 1 0\n0 0 1 1 1\n1 0 1 0 1\n1 1 0 1 0"},{"iden":"sample output 3","content":"No"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}