题目描述
You are given an array $A = [A_{1}, A_{2}, \ldots, A_{N}]$ consisting of N positive integers.
You are also given a constant K, using which you can perform the following operation on A:
Choose two distinct indices i and j such that A_{i} + A_{j} ≤ K, and remove either A_{i} or A_{j} from A.
Is it possible to obtain an array consisting of only one element using several (possibly, zero) such operations?
------ Input Format ------
- The first line of input contains a single integer T, denoting the number of test cases. The description of T test cases follows.
- The first line of each test case contains two space-separated integers N and K.
- The second line contains $N space-separated integers A_{1}, A_{2}, \ldots, A_{N}$.
------ Output Format ------
For each test case, print "YES" if it is possible to obtain an array consisting of only one element using the given operation, otherwise print "NO".
You may print each character of the string in uppercase or lowercase (for example, the strings "yEs", "yes", "Yes" and "YES" will all be treated as identical).
------ Constraints ------
$1 ≤ T ≤ 10^{3}$
$1 ≤ N ≤ 10^{5}$
$1 ≤ A_{i}, K ≤ 10^{9}$
- Sum of $N$ over all test cases does not exceed $2\cdot 10^{5}$
----- Sample Input 1 ------
3
1 3
1
3 3
2 2 2
4 7
1 4 3 5
----- Sample Output 1 ------
YES
NO
YES
----- explanation 1 ------
Test case $1$: The length of the array is already $1$.
Test case $2$: There is no way to delete an element from the given array.
Test case $3$: One possible sequence of operations is:
- Choose $i = 1, j = 4$ and remove $A_{j} = 5$. Hence the array becomes $[1, 4, 3]$.
- Choose $i = 2, j = 3$ and remove $A_{i} = 4$. Hence the array becomes $[1, 3]$.
- Choose $i = 1, j = 2$ and remove $A_{i} = 1$. Hence the array becomes $[3]$, which is of length $1$.
输入格式
见题面
输出格式
见题面