#include <bits/stdc++.h>
using namespace std;

#define fi(i,s,e) for(int i = (s); i <= (e); i++)
#define fd(i,e,s) for(int i = (e); i >= (s); i--)
#define deb(x) cout << #x << " = " << (x) << " "
#define ll long long


int main() {

#ifndef ONLINE_JUDGE
	freopen("../inp.txt", "r", stdin);freopen("../outp.txt", "w", stdout);
#else
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#endif

	int t, n, d, A[105];

	cin >> t;

	while (t--) {
		int m1 = INT_MAX, m2 = INT_MAX;
		bool flag = false, res;
		cin >> n >> d;
		fi(i,1,n) {
			cin >> A[i];
			if (A[i] < m1) { m2 = m1; m1 = A[i];}
			else if (A[i] < m2) { m2 = A[i];}
		}

		if (m1+m2 <= d) flag = true;

		fi(i,1,n) {
			res = flag | (A[i] <= d);
			if (!res) break;
		}

		if (res) cout << "YES\n";
		else cout << "NO\n";
	}

	return 0;
}