#include<algorithm>
#include<iostream>
using namespace std;
int a[101];
int main()
{
    int i,j,t,n,d;
    cin>>t;
    for(i=1;i<=t;i++)
	{
        cin>>n>>d;
        for(j=1;j<=n;j++) cin>>a[j];
        sort(a+1,a+n+1);
        if(a[1]+a[2]>d&&a[n]>d) cout<<"NO"<<endl;
        else cout<<"YES"<<endl;
    }
    return 0;
}