In the match between Bangladesh vs Zimbabwe, Bangladeshi wicket-keeper Nurul Hasan made a silly mistake in the last ball and almost compromised team’s win. After the match, Captain Sakib-Al Hasan was angry at Nurul. So, he asked Man of the match winner Taskin Ahmed to give a permutation of integers . Sakib gave the permutation to Nurul and an integer and told him to sort the array in increasing order using only one move which is:
Now find out if Nurul will be able to sort the array in increasing order. Note that he can make only one move.
A permutation of integers is an array where each integers between and exactly once and in any order. and are permutations where and aren’t.
A subset of an array can be obtained by deleting some elements(can be none or all) from the array. Deleting elements are not necessarily consecutive. and are some of the subsets of while is not.
First line of input will contains an integer .
Each test case contains two lines. In first line there will be two integers and .
Second line will contain an array integers. It is guaranteed that the array is a permutation of .
Sum of over all test cases won’t exceed .
For each test case, Print if Nurul Hasan will be able to sort the array in increasing order using exactly one move else print .
Input | Output |
---|---|
2 5 2 4 1 5 2 3 5 1 4 1 5 2 3 | Yes No |
For first test case, Nurul Hasan can take the subset and put it in back of the array or take the subset and put it on front. As , he will have to go with the first choice. |