

#include <iostream>
#include <bits/stdc++.h>
using namespace std;

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

    return 0;
}
