Setsuna has a permutation of length $$$n$$$. It is guaranteed that $$$n$$$ is an even number. Now she divides the front $$$\frac n2$$$ numbers as sequence $$$A$$$ and the last $$$\frac n2$$$ numbers as sequence $$$B$$$, then performs the following operations:
It is easy to find that sequence $$$P$$$ is also a permutation.
Now Setsuna wants to know that for all $$$n!$$$ permutations, if there exists a permutation that can get permutation $$$P$$$ through the operations above. Print "Yes" if there exists such a permutation, else print "No"(without the quotes).
The first line contains a number $$$T\ (1\le T\le 100)$$$, representing the number of test cases.
For each test case:
For each test case, output one line. If there exists such a permutation, output "Yes", otherwise output "No" (without quotes).
3 4 1 3 2 4 8 1 2 3 4 5 7 6 8 12 1 2 3 10 5 6 7 8 4 9 11 12
Yes Yes No
Name |
---|