#include<iostream>
#include<vector>
#include<algorithm>
#include<stdlib.h>
#include<time.h>
#include<math.h>
#include<stdio.h>
#include<string>
#include<set>
#include<iomanip>
#include<numeric>
#include<map>
#include<limits>
#include<unordered_set>
#include<array>
#include<deque>

using namespace std;

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	std::cout.tie(0);
	long long t, q, x, l, y, r, g, k, c, m, p;
	long long n;
	string s;
	cin >> t;
	while (t--)
	{
		cin >> n >> k;
		vector<int>a(n);
		int flag = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> a[i];
			if (a[i] > k)
			{
				flag = 1;
			}
		}
		if (flag == 0)
		{
			cout << "YES";
		}
		else {
			sort(a.begin(), a.end());
			if (a[0] + a[1] <= k)
			{
				cout << "YES";
			}
			else {
				cout << "NO";
			}
		}
		cout << endl;
	}
	return 0;
}

