#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,d,t;
	cin>>t;
	while(t--)
	{
	  	
	cin>>n>>d;
	int arr[n];
	for(int i=0;i<n;i++)
	{
		cin>>arr[i];
	}	
	sort(arr,arr+n);
	
	if(arr[n-1]>d)
	{
	   if(arr[0]+arr[1]>d)
	   cout<<"NO"<<endl;	
		else
		cout<<"YES"<<endl;
		
		}	
		else
		{
			cout<<"YES"<<endl;
		}
	}

	
}