{"raw_statement":[{"iden":"problem statement","content":"You are given two sequences of $N$ numbers: $A=(A_1,A_2,\\ldots,A_N)$ and $B=(B_1,B_2,\\ldots,B_N)$.\nTakahashi can repeat the following operation any number of times (possibly zero).\n\n> Choose three pairwise distinct integers $i$, $j$, and $k$ between $1$ and $N$.  \n> Swap the $i$\\-th and $j$\\-th elements of $A$, and swap the $i$\\-th and $k$\\-th elements of $B$.\n\nIf there is a way for Takahashi to repeat the operation to make $A$ and $B$ equal, print `Yes`; otherwise, print `No`.  \nHere, $A$ and $B$ are said to be equal when, for every $1\\leq i\\leq N$, the $i$\\-th element of $A$ and that of $B$ are equal."},{"iden":"constraints","content":"*   $3 \\leq N \\leq 2\\times 10^5$\n*   $1\\leq A_i,B_i\\leq N$\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$ $A_2$ $\\ldots$ $A_N$\n$B_1$ $B_2$ $\\ldots$ $B_N$"},{"iden":"sample input 1","content":"3\n1 2 1\n1 1 2"},{"iden":"sample output 1","content":"Yes\n\nPerforming the operation once with $(i,j,k)=(1,2,3)$ swaps $A_1$ and $A_2$, and swaps $B_1$ and $B_3$,  \nmaking both $A$ and $B$ equal to $(2,1,1)$. Thus, you should print `Yes`."},{"iden":"sample input 2","content":"3\n1 2 2\n1 1 2"},{"iden":"sample output 2","content":"No\n\nThere is no way to perform the operation to make $A$ and $B$ equal, so you should print `No`."},{"iden":"sample input 3","content":"5\n1 2 3 2 1\n3 2 2 1 1"},{"iden":"sample output 3","content":"Yes"},{"iden":"sample input 4","content":"8\n1 2 3 4 5 6 7 8\n7 8 5 6 4 3 1 2"},{"iden":"sample output 4","content":"No"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}