{"raw_statement":[{"iden":"problem statement","content":"You are given integer sequences of length $N$: $A=(A_1,A_2,\\cdots,A_N)$ and $B=(B_1,B_2,\\cdots,B_N)$, and an integer $K$.\nYou can perform the following operation zero or more times.\n\n*   Choose integers $i$ and $j$ ($1 \\leq i,j \\leq N$). Here, $|i-j| \\leq K$ must hold. Then, change the value of $A_i$ to $A_j$.\n\nDetermine whether it is possible to make $A$ identical to $B$.\nThere are $T$ test cases for each input."},{"iden":"constraints","content":"*   $1 \\leq T \\leq 125000$\n*   $1 \\leq K < N \\leq 250000$\n*   $1 \\leq A_i,B_i \\leq N$\n*   The sum of $N$ across all test cases in each input is at most $250000$.\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$T$\n$case_1$\n$case_2$\n$\\vdots$\n$case_T$\n\nEach test case is given in the following format:\n\n$N$ $K$\n$A_1$ $A_2$ $\\cdots$ $A_N$\n$B_1$ $B_2$ $\\cdots$ $B_N$"},{"iden":"sample input 1","content":"4\n3 1\n1 1 2\n1 2 2\n5 4\n2 4 5 1 3\n2 1 3 2 2\n13 1\n3 1 3 3 5 3 3 4 2 2 2 5 1\n5 3 3 3 4 2 2 2 2 5 5 1 3\n20 14\n10 6 6 19 13 16 15 15 2 10 2 16 9 12 2 6 13 5 5 9\n5 9 6 2 10 19 16 15 13 12 10 2 9 6 5 16 19 12 15 13"},{"iden":"sample output 1","content":"Yes\nYes\nNo\nYes\n\nConsider the first test case. If we operate with $i=2$ and $j=3$, the value of $A_2$ will be changed to $A_3=2$, resulting in $A=(1,2,2)$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}