Problem 1131 --Find the demon[Easy]1131: Find the demon[Easy]
Time Limit: 1 Sec Memory Limit: 128 MB
Submit: 1347 Solved: 282
[Submit][Status][Web Board]Description
There were various kinds of demons in Binary Forest. They committed terrible crimes. However, no one saw their faces exactly, the only known thing is the height of every kind (demons for the same kind all share a common height, which is different from any other kind). One day, the sheik of the forest asked all men lived in the forest to line up and stand in ascending order of their heights, but he didn't know how to find the demons. Could you please help the poor sheik?
Input
The first line will be an integer T (100<=T<=1000), which is the number of test cases. For each case have two lines. The first line of the input contains two number n and m, n is the number of the men in the forest (1<=n<=106), and m is the demon's height. The second line contains n numbers which are the heights of the men in the forest. You should determine whether demon(s) is(are) among the men or not.
Output
For each case, output only one line. If there is(are) demon(s) among the men, output YES, otherwise output NO.
Sample Input
2
3 4
1 2 3
3 1
1 2 3
Sample Output
NO
YES
HINT
Source
[Submit][Status]