#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;
typedef double db;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

#define maxn 1000001
#define pb push_back
#define fori(a,b) for(int i = a; i<b; ++i)
#define forj(a,b) for(int j = a; j<b; ++j)
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(x) x.begin(), x.end()
#define rs(a,n) a.resize(n)

using namespace std;

vi a;
int t,n,d;

int main()
{
    fast;
    //freopen("A.INP","r",stdin);
    //freopen("A.OUT","w",stdout);
    cin>>t;
    while (t--)
    {
        cin>>n>>d;
        bool ck = true;
        rs(a,n);
        fori(0,n)
        {
            cin>>a[i];
            if (a[i] > d) { ck = false;}
        }
        sort(all(a));
        if (!ck && a[0] + a[1] <= d) ck = true;
        if (ck) cout<<"yes\n";
        else cout<<"no\n";
    }
    return 0;
}
