#include <bits/stdc++.h>
using namespace std;
#define for0(i,n) for(long long i = 0;i < n;i++)
#define for1(i,n) for(long long i = 1;i <= n;i++)
#define forr(i,a,n) for(long long i = a;i <= n;i++)
#define forrr(i,a,n,m) for(long long i = a;i <= n;i+=m)
#define what_is(x) cout  << #x << " is " << x << endl
#define _is(x) << #x << " is " << x << endl
 
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define st first
#define nd second
 
typedef pair<int,int> pii;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef long double ld;
//typedef rsort(vector<int> arr, arr + n) sort(arr,arr + n,[](int a,int b){return a > b;})
 
#define MAX (10000000)
#define MOD (1000000000+7)
#define INF (1e9+1000)
 
ll t, n, k, arr[200005], d, u;

int main(){
    #ifdef DEBUG
    freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);
    #endif
    cin>>t;
    while(t--){
        cin>>n>>k;
        for0(i, n)
            cin>>arr[i];
        d = arr[0];
        u = arr[0]+k;
        for1(i, n-2){
            u = min(u+k-1, arr[i]+k+k-1);
            d = max(d-k+1, arr[i]);
            if(u - d < k){
                cout<<"NO"<<endl;
                goto end;
            }
            //cout<<i<<" "<<d<<" "<<u<<endl;
        }
        u = min(u+k-1, arr[n-1]+k);
        d = max(d-k+1, arr[n-1]);
        if(u - d < k){
            cout<<"NO"<<endl;
            goto end;
        }
        cout<<"YES"<<endl;
        end:;
    }
    return 0;
}