#include <bits/stdc++.h>

using namespace std;

int main(){
long a=0,t;
cin>>t;
while(t--){
        long n,d;
    cin>>n>>d;
    long A[n];
    bool ne=false;
    long b=1000000000;a=100000000;
    deque<long> B;
    for(long i=0;i<n;i++){
        cin>>A[i];
        B.push_back(A[i]);
        if(A[i]>d)ne=true;
    }
    sort(B.begin(),B.end());
    b=B[0];
    a=B[1];
    if(ne){
        if(a+b<=d){
            cout<<"YES"<<endl;
        }else
        {cout<<"NO"<<endl;}
    }else{
    cout<<"YES"<<endl;
    }

}
return 0;
}
