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

void solve(){
    long long n,k;
    cin>>n>>k;
    vector<long long> A(n);
    for(int i=0; i<n; ++i) cin>>A[i];
    long long l=A[0], r = A[0];
    for(int i=1; i<n; ++i){
        l = max(A[i], l-k+1);
        r = min(r+k-1, A[i]+k-1);
        if(l>r){
            cout<<"NO\n";
            return;
        }
    }
    if(A[n-1]<=r && A[n-1]>=l){
        cout<<"YES\n";
        return;
    }
    cout<<"NO\n";
}

int main(){
    int step;
    cin>>step;
    ++step;
    while(--step) solve();
}