Rachel has some candies and she decided to distribute them among (N) kids. The (i)-th kid receives (A_i) candies. The kids are happy if and only if the difference between the highest and lowest number of candies received is less than (X). Your task is to determine if the children are happy or not.
Input Format
The first line contains an integer (T) representing the number of test cases.
For each test case, the following two lines are provided:
The first line contains two integers (N) (the number of kids) and (X) (the happiness threshold).
The second line contains (N) integers (A_1, A_2, \ldots, A_N) representing the number of candies each kid receives.
Output Format
For each test case, print "YES" (without quotes) if the kids are happy; otherwise, print "NO" (without quotes).
Constraints
(1 \leq T \leq 100)
(1 \leq N, X \leq 10^5)
(1 \leq A_i \leq 10^5)
Example Input
text
2
5 6
3 5 6 8 1
3 10
5 2 9
Example Output
text
NO
YES
Explanation
Test Case 1: The difference between the maximum and minimum candies received is (8 - 1 = 7). Since (7) is greater than (6), the kids are not happy.
Test Case 2: The difference between the maximum and minimum candies received is (9 - 2 = 7). Since (7) is less than (10), the kids are happy.
Implementation Requirements
Please implement the solution in the /app/ directory.
Important: place your implementation at /app/solution.py so the verifier can run it.