 #include<bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define vi vector<int>
#define w(x) int x; cin>>x; while(x--)
#define pb push_back
 

int32_t main() {
	#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
 
    fio
    w(t)
    {
        int s=0,n,k,sum=0;
        cin>>n>>k; vi v; bool b=true;
        for(int i=0;i<n;i++)
        {
            int val;
            cin>>val;
            v.pb(val);
            if(val>k)
                b=false;
        }
        if(b==false)
        {
            sort(v.begin(),v.end());
            if(v[0]+v[1]<=k)
                cout<<"YES\n";
            else
                cout<<"NO\n";
        }
        else
            cout<<"YES\n";
        
    }
} 