{"raw_statement":[{"iden":"problem statement","content":"There are two sequences $A=(A_1,\\dots,A_N)$ and $B=(B_1,\\dots,B_N)$. You can perform the following three types of operations any number of times in any order:\n\n*   Choose an index $i$ such that $A_i = -1$, and replace $A_i$ with any non-negative integer.\n*   Choose an index $i$ such that $B_i = -1$, and replace $B_i$ with any non-negative integer.\n*   Rearrange the elements of sequence $A$ in any order.\n\nDetermine whether it is possible, after these operations, for all elements of $A$ and $B$ to be non-negative and satisfy $A_1 + B_1 = A_2 + B_2 = \\dots = A_N + B_N$."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 2000$\n*   $-1 \\leq A_i \\leq 10^9$\n*   $-1 \\leq B_i \\leq 10^9$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\ldots$ $A_N$\n$B_1$ $B_2$ $\\ldots$ $B_N$"},{"iden":"sample input 1","content":"4\n2 0 -1 3\n3 -1 4 2"},{"iden":"sample output 1","content":"Yes\n\nConsider the following operations:\n\n*   Replace $A_3$ with $1$.\n*   Replace $B_2$ with $1$.\n*   Rearrange $A$ to $(1,3,0,2)$.\n\nAfter these operations, $A = (1,3,0,2)$ and $B = (3,1,4,2)$: all elements of $A$ and $B$ are non-negative, and $A_1+B_1 = A_2+B_2 = A_3+B_3 = A_4+B_4 = 4$ is satisfied."},{"iden":"sample input 2","content":"3\n1 2 3\n1 2 4"},{"iden":"sample output 2","content":"No\n\nNo matter how you perform the operations, it is impossible to satisfy $A_1+B_1 = A_2+B_2 = A_3+B_3$."},{"iden":"sample input 3","content":"3\n1 2 -1\n1 2 4"},{"iden":"sample output 3","content":"No"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}