C. Again Sort Permutation
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You are given a permutation $$$ p $$$ of length $$$n$$$.

You can do the following operation any number of times (possibly zero):

  • Choose two indices $$$i$$$ and $$$j$$$ $$$(1 \le i \lt j \le n)$$$ such that $$$ (p_i + p_j) $$$ is a composite number. Then swap $$$p_i$$$ and $$$p_j$$$.

A composite number is a positive integer greater than $$$1$$$ that is not a prime number. In other words, a composite number has divisors other than $$$1$$$ and itself. For example, $$$4, 6, 8$$$, and $$$9$$$ are composite numbers.

Determine if you can sort the permutation in increasing order after performing the given operation any number of times (possibly zero).

Input

The first line contains one positive integer $$$t$$$ $$$(1≤t≤2 \cdot 10^5)$$$ — the number of test cases.

Each test case begins with a line containing one integer $$$n$$$ $$$(1≤n≤2 \cdot 10^5)$$$.

The second line of each test case contains n integers $$$p_1…p_n (1≤p_i ≤ n)$$$. It is guaranteed that $$$p$$$ is a permutation.

The sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.

Output

For each test case, output on a separate line:

  • YES, if it is possible to sort the given permutation by applying a certain number of operations.
  • NO, otherwise.
The letters in the words YES and NO can be output in any case.
Example
Input
4
1
1
2
2 1
2
1 2
4
2 1 4 3
Output
Yes
No
Yes
No