Rachel has some candies and she decided to distribute them among $N$ kids. The ith kid receives $A_i$ candies. The kids are happy iff the difference between the highest and lowest number of candies received is less than $X$.
Find out if the children are happy or not.
-----Input:-----
- First line will contain $T$, number of testcases. Then the testcases follow. 
- The first line contains $N$ and $X$. 
- The second line contains $N$ integers $A_1,A_2,...,A_N$. 
-----Output:-----
For each test case print either "YES"(without quotes) if the kids are happy else "NO"(without quotes)
-----Constraints-----
- $1 \leq T \leq 100$
- $1 \leq N, X \leq 10^5$
- $1 \leq A_i \leq 10^5$
-----Sample Input:-----
2
5 6
3 5 6 8 1
3 10
5 2 9
-----Sample Output:-----
NO
YES
-----EXPLANATION:-----
- Example 1: Difference between maximum and minimum candies received is 8-1=7. 7 is greater than 6, therefore, the kids are not happy.
# cook your dish here
# cook your dish here
from sys import stdout, stdin


def main():
    numOfKids, difference = list(map(str, input().split()))
    numbers = [int(x) for x in stdin.readline().split()]
    numOfKids = int(numOfKids)
    difference = int(difference)
    smallest = largest = numbers[0]
    for j in range(1, len(numbers)):
        if (smallest > numbers[j]):
            smallest = numbers[j]
            min_position = j
        if (largest < numbers[j]):
            largest = numbers[j]
            max_position = j
    listDiff = largest - smallest
    #print(largest)
    #print(smallest)
    #print(difference)
    if(listDiff > difference):
        print("NO")
    elif(difference > listDiff):
        print("YES")
    elif(difference == listDiff):
        print("NO")


def __starting_point():
    testCases = int(stdin.readline())
    if 0 <= testCases <= 100:
        for _ in range(testCases):
            main()

__starting_point()
# cook your dish here
# cook your dish here
from sys import stdout, stdin


def main():
    numOfKids, difference = list(map(str, input().split()))
    numbers = [int(x) for x in stdin.readline().split()]
    numOfKids = int(numOfKids)
    difference = int(difference)
    smallest = largest = numbers[0]
    for j in range(1, len(numbers)):
        if (smallest > numbers[j]):
            smallest = numbers[j]
            min_position = j
        if (largest < numbers[j]):
            largest = numbers[j]
            max_position = j
    listDiff = largest - smallest
    #print(largest)
    #print(smallest)
    #print(difference)
    if(listDiff > difference):
        print("NO")
    elif(difference > listDiff):
        print("YES")
    elif(difference == listDiff):
        print("NO")


def __starting_point():
    testCases = int(stdin.readline())
    if 0 <= testCases <= 100:
        for _ in range(testCases):
            main()

__starting_point()