#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define ios	    	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;



int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int n,d,cnt=0;
		cin>>n>>d;
		int a[n+10];
		for(int i=0;i<n;i++)
		{
			cin>>a[i];
			if(a[i]<=d)cnt++;
		}
		sort(a,a+n);
		if(a[0]+a[1]<=d || cnt==n)cout<<"YES\n";
		else cout<<"NO\n";
	}
}