#include<bits/stdc++.h>
#define lowbit(x) x&(-x)
#define ls rt<<1
#define rs rt<<1|1
#define lson ls,l,m
#define rson rs,m+1,r
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PAIR;
const int maxn = 1e6 + 7;
const ll mod = 2147483648;
const double eps = 1e-5;
const int inf = 0x3f3f3f3f;
int a[107];

int main(){
	int cas;
	scanf("%d",&cas);
	while(cas--){
		int n,d;
		scanf("%d %d",&n,&d);
		int fl = 1;
		for(int i = 1;i <= n;i++){
			scanf("%d",&a[i]); 
			if(a[i] > d) fl = 0;
		}
		sort(a+1,a+1+n);
		if(fl) printf("YES\n");
		else{
			if(a[1] + a[2] <= d){
				printf("YES\n");
			}else printf("NO\n");
		}
		
	}
	
    return 0;    
}
