All Submissions


Problem Specification

A friend of yours has created a random number generator and he wants you to check it. Your friend will give you n numbers and the value k.
There will be a certain number of pairs which have an absolute difference being equal to k. If this number exceeds half the value of n then the numbers generated are not random.

Input Specification

The first line of input contains the number of test cases : t.
Each test case contains two lines of input : the first specifying the values of n and k, and the second specifying the n distinct numbers generated.
Output Specification:

One line containing either YES or NO stating whether the numbers are random or not.

Sample Input


2
5 2
5 3 1 2 4
7 2
6 2 8 1 9 4 5


Sample Output


NO
YES


Constraints

1<=n,k. They fit into the value of signed integer.

Problem Setter : Neesha Sinha

Languages: C,C++,C#,Java,JavaScript,Pascal,Perl,PHP,Python,Ruby

Time Limit: 1 Second(s)
Score: 100 Point(s)
Input File Limit: 50000 Bytes

Submit

Login to post clarification.

No Clarifications.

Contest

Mode Judge

Passive

Online

Overall Rankings

RankNameScore
1xyz0
2Ams0
3TIP0
4team420
5xyzz0
6asdasdasd0
7abcd0
8khankhan0
9Gabriel0
10gigel0