#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n,d;
        cin>>n>>d;
        int a[n];
        vector<int> v;
        int flag=0;
        for(int i=0;i<n;i++)
        {
            cin>>a[i];
            if(a[i]<d)
            {
                v.push_back(a[i]);
            }
            if(a[i]>d)
            {
                flag++;
            }
        }
        int s=v.size();
        int k=0;
        int j=0;
        if(s<2)
        {
            k++;
        }
        
        else if(s>=2)
        {
            sort(v.begin(),v.end());
            int sum=v[0]+v[1];
            if(sum<=d)
            j++;
        }
        if(flag==0)
        {
            cout<<"YES"<<endl;
        }
        else if(flag!=0)
        {
            if(j>0)
            cout<<"YES"<<endl;
            else 
            cout<<"NO"<<endl;
        }
    }
}