#include <bits/stdc++.h>
#include <string.h>
using namespace std;
#define KP                            \
	ios_base::sync_with_stdio(false); \
	cin.tie(NULL);
#define rep(i, a, b) for (int i = a; i < b; i++)
#define ll long long int
#define MIN -1e9
#define MAX 1e9
#define endl "\n"
#define vi vector<int>
#define pb push_back
#define all(v) v.begin(), v.end()

void solve()
{
	ll n, d;
	cin >> n >> d;

	ll a[n], g = 0;

	rep(i, 0, n)
	{
		cin >> a[i];

		if (a[i] <= d)
			g++;
	}

	sort(a, a + n);

	ll t = a[0] + a[1];

	if (t <= d || g == n)
		cout << "YES" << endl;
	else
	{
		cout << "NO" << endl;
	}
}

int main()
{
	KP;
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ll tt;
	cin >> tt;
	while (tt--)
		solve();

	return 0;
}