#include <bits/stdc++.h>
using namespace std;

int main(){
	int t;
	cin >> t;

	while(t--){
		int n, d;
		cin >> n >> d;

		int arr[n];

		bool possible = true;
		for(int i = 0; i < n; i++){
			cin >> arr[i];
		}

		for(int i = 0; i < n; i++){
			if(arr[i] > d){
				possible = false;
			}
		}

		int small1 = arr[0];
		int ind1 = 0;

		for(int i = 0; i < n; i++){
			if(small1 > arr[i]){
				ind1 = i;
				small1 = arr[i];
			}
		}

		int small2 = 200;
		int ind2 = 0;

		for(int i = 0; i < n; i++){
			if(i != ind1){
				if(small2 > arr[i]){
					small2 = arr[i];
					ind2 = i;
				}
			}
		}

		if(small1 + small2 <= d || possible){
			cout << "YES\n";
		}else{
			cout << "NO\n";
		}
	}
}