#include <bits/stdc++.h>

using namespace std;
using ll = long long;

/// edit everything

int main() {

    int t;
    cin >> t;

    while(t--){
        int n, d;
        cin >> n >> d;
        vector<int> v(n);
        for(int &i : v) cin >> i;
        sort(v.begin(),v.end());
        if(v[0]+v[1] <= d || v.back() <= d) cout << "YES" << endl;
        else cout << "NO" << endl;
    }

    return 0;
}
