//KDB G.O.A.T MID
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define pf push_front
#define f first
#define se second
#define io ios_base::sync_with_stdio(false),cin.tie(NULL)
#define MAXN 500009
#define in insert
#define lb lower_bound
#define ub upper_bound
#define pi pair<int,int>
#define N 1009
signed main() 
{
    io;
    int t;cin>>t;
    while(t--)
    {
        int i,n,d;cin>>n>>d;
        int a[n];
        for(i=0;i<n;i++) cin>>a[i];
        sort(a,a+n);
        if(a[0]+a[1]<=d||a[n-1]<=d) cout<<"Yes\n";
        else cout<<"No\n";
    }
}