#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main() 
{
	// your code goes here
	ll t,l,r,k,n,b,m,d,w,h;string s;
	cin>>t;
	while(t--)
	{
	    cin>>n>>d;ll a[n],f=0;
	    for(int i=0;i<n;i++)
	    {
	        cin>>a[i];
	        if(a[i]>d)
	        {
	            f=1;
	  
	        }
	    }
	    if(f==1)
	    {
	        sort(a,a+n);
	        if(a[0]+a[1]<=d)
	        {
	            cout<<"YES"<<endl;
	        }
	        else
	        cout<<"NO"<<endl;
	    }
	    else
	    cout<<"YES"<<endl;
	}
	return 0;
}