While doing group projects together in their university life, Meena and Kabir used to dream of opening a vintage-style book-cafe. Years later, their dream is finally coming true. The heart of their cafe is a Shelf, holding $$$n$$$ of their favorite books.
Kabir has just finished unboxing the books into an initial order $$$a$$$. Each book is identified by an ID number; since they have several copies of certain favorites, multiple books may share the same ID.
As always, Meena suggests a game: they win if they can reach their "dream" arrangement $$$b$$$—the one from their university notebooks—by only swapping books that are exactly $$$m$$$ slots apart. Formally, they can choose an index $$$i \le n-m$$$, and swap the books at index $$$i$$$ and $$$i+m$$$. As they sip their coffee and enjoy the quiet atmosphere of their new cafe, they wonder if the IDs on the shelf will allow them to win their game.
The first line of input contains $$$t$$$ ($$$1 \le t \le 10^5$$$), the number of testcases.
The first line of each testcase contains two space-separated integers $$$n$$$ and $$$m$$$ ($$$1 \le m \lt n \le 10^5$$$).
The second line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the IDs of the books in which Kabir unboxed them.
The third line contains $$$n$$$ integers $$$b_1, b_2, \dots, b_n$$$ ($$$1 \le b_i \le 10^9$$$) — the ordered IDs in the dream arrangement $$$b$$$.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, output "YES" if it is possible for them to win, "NO" otherwise.
You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.
16 21 2 3 4 5 61 6 3 4 5 2
Yes
42 15 44 53 15 3 13 1 511 72 5 5 2 5 3 3 4 5 2 15 5 2 4 3 2 5 3 5 1 24 34 3 2 34 2 3 3
YesYesNoNo
In the only testcase of the first sample, selecting $$$i = 2$$$ for first operation, $$$i = 4$$$ for second, and $$$i = 2$$$ for third operation makes arrangement $$$a$$$ equal to arrangement $$$b$$$, thus the answer is "YES".
| Name |
|---|


