{"raw_statement":[{"iden":"problem statement","content":"We have a grid with $H$ horizontal rows and $W$ vertical columns, where each square contains an integer. The integer written on the square at the $i$\\-th row from the top and $j$\\-th column from the left is $A_{i, j}$.\nDetermine whether the grid satisfies the condition below.\n\n> $A_{i_1, j_1} + A_{i_2, j_2} \\leq A_{i_2, j_1} + A_{i_1, j_2}$ holds for every quadruple of integers $(i_1, i_2, j_1, j_2)$ such that $1 \\leq i_1 < i_2 \\leq H$ and $1 \\leq j_1 < j_2 \\leq W$."},{"iden":"constraints","content":"*   $2 \\leq H, W \\leq 50$\n*   $1 \\leq A_{i, j} \\leq 10^9$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$H$ $W$\n$A_{1, 1}$ $A_{1, 2}$ $\\cdots$ $A_{1, W}$\n$A_{2, 1}$ $A_{2, 2}$ $\\cdots$ $A_{2, W}$\n$\\vdots$\n$A_{H, 1}$ $A_{H, 2}$ $\\cdots$ $A_{H, W}$"},{"iden":"sample input 1","content":"3 3\n2 1 4\n3 1 3\n6 4 1"},{"iden":"sample output 1","content":"Yes\n\nThere are nine quadruples of integers $(i_1, i_2, j_1, j_2)$ such that $1 \\leq i_1 < i_2 \\leq H$ and $1 \\leq j_1 < j_2 \\leq W$. For all of them, $A_{i_1, j_1} + A_{i_2, j_2} \\leq A_{i_2, j_1} + A_{i_1, j_2}$ holds. Some examples follow.\n\n*   For $(i_1, i_2, j_1, j_2) = (1, 2, 1, 2)$, we have $A_{i_1, j_1} + A_{i_2, j_2} = 2 + 1 \\leq 3 + 1 = A_{i_2, j_1} + A_{i_1, j_2}$.\n*   For $(i_1, i_2, j_1, j_2) = (1, 2, 1, 3)$, we have $A_{i_1, j_1} + A_{i_2, j_2} = 2 + 3 \\leq 3 + 4 = A_{i_2, j_1} + A_{i_1, j_2}$.\n*   For $(i_1, i_2, j_1, j_2) = (1, 2, 2, 3)$, we have $A_{i_1, j_1} + A_{i_2, j_2} = 1 + 3 \\leq 1 + 4 = A_{i_2, j_1} + A_{i_1, j_2}$.\n*   For $(i_1, i_2, j_1, j_2) = (1, 3, 1, 2)$, we have $A_{i_1, j_1} + A_{i_2, j_2} = 2 + 4 \\leq 6 + 1 = A_{i_2, j_1} + A_{i_1, j_2}$.\n*   For $(i_1, i_2, j_1, j_2) = (1, 3, 1, 3)$, we have $A_{i_1, j_1} + A_{i_2, j_2} = 2 + 1 \\leq 6 + 4 = A_{i_2, j_1} + A_{i_1, j_2}$.\n\nWe can also see that the property holds for the other quadruples: $(i_1, i_2, j_1, j_2) = (1, 3, 2, 3), (2, 3, 1, 2), (2, 3, 1, 3), (2, 3, 2, 3)$.  \nThus, we should print `Yes`."},{"iden":"sample input 2","content":"2 4\n4 3 2 1\n5 6 7 8"},{"iden":"sample output 2","content":"No\n\nWe should print `No` because the condition is not satisfied.  \nThis is because, for example, we have $A_{i_1, j_1} + A_{i_2, j_2} = 4 + 8 > 5 + 1 = A_{i_2, j_1} + A_{i_1, j_2}$ for $(i_1, i_2, j_1, j_2) = (1, 2, 1, 4)$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}