Problem
This Christmas, Santa has a list of N children for gift distribution. Initially, he decides to gift A_{i} chocolates to the i ^ (th) child. However, children are not happy with this distribution.
He then decides to redistribute the chocolates in a way, such that:
• Each child has at least one chocolate;
• The difference of chocolates between any pair of children is not more than K.
Find whether such distribution is possible.
Input Format
• The first line of input will contain a single integer T, denoting the number of test cases.
• Each test case consists of multiple lines of input.
• The first line of each test case contains two space-separated integers N and K - the number of children and the maximum difference of chocolates between any two children.
• The next line of each test case contains N space-separated integers A_{1}, A_{2} ,…,A N . denoting the initial distribution of chocolates.Output Format
For each test case, output on a new line, YES, if Chef can redistribute the chocolates in the above mentioned way. Otherwise, output NO.
Note that you may print each character in uppercase or lowercase. For example, the strings NO, no, N and no are considered the same.
Constraints
• 1 <= T <= 1000
• 1 <= N <= 10 ^ 5
• 0 <= K <= 100
• 0 <= A_{i} <= 100
• The sum of N over all test cases won’t exceed 10 ^ 6 .Sample 1:
Input
Output
3
YES
52
NO
70142
YES
4 100
1020
43
1102
Explanation:
Test case 1: A possible redistribution satisfying all conditions is [2, 4, 2, 4, 2]. Note that all children have at least 1 chocolate and the maximum difference of chocolates between any two children is 2.
Test case 2: It is not possible to have a redistribution satisfying all conditions.
Test case 3: A possible redistribution satisfying all conditions is [1, 1, 1, 1]. Note that all children have at least 1 chocolate and the maximum difference of chocolates between any two children is 0, which is less than 3.