#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<set>
#include<stack>
#define ll long long int
#define mod 1000000007
#define max 500001
using namespace std;

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