#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define ins insert
#define sb substr
#define con continue
#define ub upper_bound
#define lb lower_bound
#define sp fixed<<setprecision
#define bp __builtin_popcountll
#define pll pair<ll,ll>
#define pld pair<ld,ld>
#define FOR(i,n) for(i=0;i<n;i++)
#define FOR(i,n,a) for(ll i=a;i<n;i++)
#define FORB(i,n) for(i=n-1;i>=0;i--)
#define FORB(i,n,a) for(i=n-1;i>=a;i--)
#define input(i,n,A) FOR(i,n,0)cin>>A[i]
#define enter cout<<"\n"
#define MOD 1000000007
#define vll vector<ll> 
#define ar array
using namespace std;
ll fact[1000001],power[1000001];
ll powerr(ll x, ll y);
ll mpower(ll x, ll y, ll p);
ll gcdExtended(ll a, ll b);
bool isPrime(ll n);
//ll dp[1001][1001];
ll y[1000000] = {0};
bool sortbysec(const pair<int,int> &a, const pair<int,int> &b) 
{ 
    return (a.second < b.second); 
} 
ll dp[1001][1001];
ll binomialCoeff(ll n, ll k)
{
    // If value in lookup table then return
    if (dp[n][k] != -1) //     
        return dp[n][k];
 
    // store value in a table before return
    if (k == 0) {
        dp[n][k] = 1;
        return dp[n][k];
    }
     
    // store value in table before return
    if (k == n) {
        dp[n][k] = 1; 
        return dp[n][k];
    }
     
    // save value in lookup table before return
    dp[n][k] = (binomialCoeff(n - 1, k - 1) +
               binomialCoeff(n - 1, k))%MOD;
    return dp[n][k];
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t,j,k,l,h,p,q,r,x,i,y,z,a,b,c,d,f,n,m,M=1000000007;
    char ch,ch2,ch3;
    string s1,s2,s3;
    //vector<ll> v,w;
    set<ll> S;
   // t = 1;
    cin>>t;
//    vector<char *> v;
    while(t--){
        cin >> n >> k;
        ll A[n];
        input(i,n,A);
        ll minr,maxr;
        maxr = A[0] + k;
        minr = A[0];
        ll flag = 0;
        //cout << minr << " " << maxr;
        //enter;
        FOR(i,n - 1,1){
            ll mx,mn;
            if(A[i] >= maxr){
                flag = 1;
                break;
            }
            else if(A[i] + 2*k - 1 <= minr){
                flag = 1;
                break;
            }
            if(A[i] + 2*k - 1 > maxr)maxr = min(A[i] + 2*k - 1,maxr + k - 1);
            else maxr = A[i] + 2*k - 1;
            if(A[i] >= minr)minr = A[i];
            else if(minr - k < 0)minr = 0;
            else minr = max(minr - k + 1, A[i]);
            //cout << i << " " << minr << " " << maxr;
            //enter;
        }
      //  cout << flag;
      //  enter;
        if(A[n - 1] + k <= minr){
            flag = 1;
        }
        if(A[n - 1] >= maxr){
            flag = 1;
        }
        if(flag)cout << "NO\n";
        else cout << "YES\n";
    }
}
ll gcdExtended(ll a, ll b){
    if (b == 0){
        return a;
    }
    else
        return gcdExtended(b,a%b);
}
 
ll mpower(ll x, ll y, ll p){
    ll res = 1;
    x = x % p;
    while(y > 0){
        if(y & 1) res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
 
ll powerr(ll x, ll y){
    ll res = 1;
    while (y > 0){
        if (y & 1) res = res*x;
        y = y>>1;
        x = x*x;
    }
    return res;
}
 
bool isPrime(ll n){
    if (n <= 1)  return false;
    if (n <= 3)  return true;
    if (n%2 == 0 || n%3 == 0) return false;
    ll p=sqrt(n);
    for(int i=5;i<=p;i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
            return false;
    return true;
}