#include<bits/stdc++.h>

using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n,d;
        cin>>n>>d;
        int l[n];
        for(int i=0;i<n;i++)
        {
            cin>>l[i];
        }
        sort(l,l+n);
        bool b = true;
        if(l[n-1]<=d)
        {
            cout<<"YES";
            b = false;
        }
        if(b==true)
        {
        if(l[0]+l[1]<=d)
        {
            cout<<"YES";
        }
        else
        {
            cout<<"NO";
        }
        }
        cout<<endl;
    }
    return 0;
}
