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

typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t;
    cin>>t;
    while(t--){
        int n,k;
        cin>>n>>k;
        int a[n];
        for(int i=0;i<n;i++) {cin>>a[i];a[i]+=k;}

        bool f=1;
        if(n==2){
            if(abs(a[0]-a[1])>=k) cout<<"NO"<<endl;
            else cout<<"YES"<<endl;
            continue;
        }
        for(int i=1;i<n-1;i++){
            int m=k-1;
            if(a[i]-a[i-1]>=k){
                f=0;
                break;
            }
            if(a[i]>a[i-1]&&a[i]>a[i+1]) continue;
            if(a[i-1]>a[i]){
                if(a[i-1]-a[i]>=2*k-1) {f=0; break;}
                else if(a[i-1]-a[i]>=k){
                    m-=(a[i-1]-a[i])-k+1;
                    a[i]+=(a[i-1]-a[i])-k+1;

                }
            }
            if(a[i-1]<a[i]) m=k-1-a[i]+a[i-1];
            if(a[i]<=a[i+1]){
                a[i]+=m;
                if(a[i+1]-a[i]>=k){
                    f=0;
                    break;
                }
            }
        }
        if(abs(a[n-1]-a[n-2])>=k) f=0;

        if(f) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;

    }
}
