#P1187D. Subarray Sorting
Subarray Sorting
Description
You are given an array and an array .
For one operation you can sort in non-decreasing order any subarray of the array .
For example, if and you choose subbarray , then the array turns into .
You are asked to determine whether it is possible to obtain the array by applying this operation any number of times (possibly zero) to the array .
The first line contains one integer () — the number of queries.
The first line of each query contains one integer ().
The second line of each query contains integers ().
The third line of each query contains integers ().
It is guaranteed that over all queries in a test.
For each query print YES (in any letter case) if it is possible to obtain an array and NO (in any letter case) otherwise.
Input
The first line contains one integer () — the number of queries.
The first line of each query contains one integer ().
The second line of each query contains integers ().
The third line of each query contains integers ().
It is guaranteed that over all queries in a test.
Output
For each query print YES (in any letter case) if it is possible to obtain an array and NO (in any letter case) otherwise.
Note
In first test case the can sort subarray , then will turn into , and then sort subarray .