#include <stdio.h>
int min_sum(int*b,int num) {
    int i,j;
    int minsum=0;
    for(i=0; i<num-1; ++i) {
        for(j=i+1; j<num; ++j) {
            if(minsum==0 || (*(b+i)+*(b+j))<minsum ) {
                minsum = *(b+i) +*(b+j);
            }
        }
    }
    return minsum;
}
int main () {
    int tests;
    scanf("%d", &tests);
    int i;
    for(i=0; i<tests; ++i) {
        int n,d;
        int j;
        int counta=0;
        int minsum;
        scanf("%d%d", &n, &d);
        int a[n];
        for(j=0; j<n; ++j) {
            scanf("%d", &a[j]);
            if(a[j]<=d) {
               counta=counta+1;
            }
        }
        minsum=min_sum(a,n);
        if(counta==n || minsum<=d) {
            printf("YES\n");
        }
        else {
            printf("NO\n");
        }
        
            
        
    }
}