Given n elements in an array.
You are required to sort the array in non-decreasing order the value of the element.
The elements are represented by two integers
ai – the value of the element
bi – the type of the element {0 or 1}.
He can do so by performing below operation any no of times:
Can you sort the elements in non-decreasing order?
INPUT:
The first line contains one integer t(1 ≤ t ≤ 20) — the number of test cases. The description of the test cases follows.
The first line of each test case contains one integer n(1 ≤ n ≤ 105) — the size of the arrays.
The second line contains n integers ai(1 ≤ ai ≤ 105) — the value of the ith element.
The third line containts n integers bi ( bi ∈ {0,1} ) — the type of the ith element.
30% of test cases- (1 ≤ n ≤ 103 )
OUTPUT:
For each test case, print "YES" or "NO" (without quotes) depending on whether it is possible to sort elements in non-decreasing order of their value.
Print each letter in Upper case only.
For first test you can first swap 2nd element with third element then 3rd element with 4th element.
second test: all elements are already sorted
third test: you cannot perform swap operation.