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

int main()
{
int t;
cin>>t;
while(t--)
{
    ll n,d,a;
    cin>>n>>d;
    vector<ll>v;
    vector<ll>v1;
    for(ll i=0;i<n;i++)
    {
        cin>>a;
        if(a<=d)
            v.push_back(a);
        else
            v1.push_back(a);
    }
    ll l=v.size();
    ll l1=v1.size();
    if(l==n)
        cout<<"YES\n";
        else if(l==1||l==0)
        {
            cout<<"NO\n";
        }
    else{

        sort(v.begin(),v.end());
        ll sum=v[0]+v[1];
        if(sum<=d)
             cout<<"YES\n";
        else
             cout<<"NO\n";
    }
}


}
