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

#define ll long long
#define ld long double
#define ft first
#define sd second
#define pb push_back
#define all(v) v.begin(),v.end()
#define mset(a,b) memset(a, b, sizeof(a))
#define mp make_pair
#define ins(p) insert(p)
#define vi vector<int>
#define vvi vector<vi>
#define vll vector<ll int>
#define vvll vector<vll>
#define loop(i,j,n) for(ll i=j; i<n; i++)
#define loopto(i,j,n) for(ll i=j; i<=n; i++)
#define yup cout<<"YES\n"
#define nope cout<<"NO\n"

// To find GCD/HCF of a and b : __gcd(a,b)
// "Out beyond ideas of wrongdoing and rightdoing there is a field. I'll meet you there"

void solve(){
	ll x,n,d; cin>>n>>d;
	vll v(n);
	loop(i,0,n){
		cin>>v[i];
	}
	sort(all(v));
	if(v[n-1]<=d){
		yup; return;
	}
	if(v[0]+v[1]<=d){
		yup; return;
	}
	nope;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    
    int t=1;
    cin>>t;
    while(t--){
    	solve();
	}
	return 0;
}
