Limits 1s, 512 MB

In a vast network of interconnected servers, an advanced Artificial Intelligence named Mighty Kuddus began its mission to analyze massive data sets. One day, it stumbled upon a peculiar challenge: finding two specific arrays hidden within the sea of information. Mighty Kuddus tirelessly searched through the digital world, using complex mathematical calculations to reveal hidden arrays and make them equal. After a lengthy search, it discovered a complicated method to make the arrays equal.

As a highly skilled programmer, you find this task straightforward and easily achievable. You have arrays AA and BB of length nn discovered by Mighty Kuddus. To make the arrays equal, the only operation you can do is swap any element of the first array with any element of the second array. More formally, for each Ai(1in)A_i \: (1\le i\le n)you can swap it with any Bj(1jn)B_j \: (1\le j\le n). You can perform this operation as many times as you want(possibly zero).

Now write a program to complete the task. Two arrays AA and BB are considered equal if and only if Ai=BiA_i=B_i for all (1in)(1\le i\le n).

Input

Each test contains multiple test cases. The first line of input contains a single integer t(1t102)t \: (1\le t\le 10^2) — the number of test cases. The description of test cases follows.

The first line of each test case contains a single integer n(1n103)n \:(1≤n≤10^3) - the length of the arrays.

The second line of each test case contains nn integers A1,A2,,An1,An(1Ai105)A_1,A_2,…,A_{n-1},A_n \: (1≤A_i≤10^5) - the elements of array AA.

The third line of each test case contains nn integers B1,B2,,Bn1,Bn(1Bi105)B_1,B_2,…,B_{n-1},B_n (1≤B_i≤10^5) - the elements of array BB.

Output

For each test case, output “yes” without quotation if you can make the arrays similar otherwise output “no” without quotation. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).

Sample

InputOutput
1
3
1 3 5
5 1 3

yes

Submit

Login to submit.

Statistics

41% Solution Ratio
iffatul_anonEarliest, 11M ago
nh_nayeemFastest, 0.0s
iffatul_anonLightest, 4.9 MB
Sarwar82Shortest, 406B
Toph uses cookies. By continuing you agree to our Cookie Policy.