#include "bits/stdc++.h"

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int z; cin >> z;
    for (int q = 0; q < z; q++)
    {
        int n, d; cin >> n >> d;
        vector<int> v(n);
        for (int i = 0; i < n; i++) cin >> v[i];
        sort(v.begin(), v.end());

        if (v[0] + v[1] <= d) cout << "YES\n";
        else if (v[n - 1] <= d) cout << "YES\n";
        else cout << "NO\n";
    }

    return 0;
}