#include<iostream>
#include<map>
#include<vector>
#include<set>
#include<stack>
#include<queue>
#include<string>
#include<iterator>
#include<list>
#include<unordered_map>
#include<unordered_set>
#include<initializer_list>
#include<algorithm>
#include<cmath>
#include<numeric>
#include<initializer_list>
#include<utility>

using namespace std;

#define int long long
#define B begin()
#define E end()
#define F first
#define S second
#define LL_MAX ((LL)(1e18))
#define LL_MIN ((LL)(1e18))

const int MOD = 1e9+7;

int mfpow(int, int, int);
int invmod(int, int);
int __gcd(int, int);

int n, m, t, x, y, z, w, l, r, k, sum, mini, maxi;
string s, s1, s2;
char ch;
bool br, br1, br2;
set<int> st, st1, st2;
multiset<int> mst, mst1, mst2;
map<int, int> mp;

void solve()
{
    cin>>t;

    while(t--)
    {
        cin>>n>>k;
        vector<int> v(n);
        vector<pair<int, int> > res(n);

        for(auto &i:v)cin>>i;
        br = true;
        res[0].first = res[0].second = v[0];

        for(int i=1;i<n;i++)
        {
            x = res[i-1].first;
            y = res[i-1].second;

            x -= k-1;
            y += k-1;
            x = max(x, v[i]);
            y = min(y, v[i]+k-1);

            if(v[i]+k-1 < x || v[i] > y || x > y)br = false;
            res[i] = make_pair(x, y);
        }

        br &= (res[n-1].first == v[n-1]);

        cout<<(br?"YES":"NO")<<endl;
    }
}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	solve();

	return 0;
}

int __gcd(int x, int y)
{
    int z;
    x = abs(x);
    y = abs(y);
    if(x > y)swap(x, y);
    
    while(x)
    {
        z = y%x;
        y = x;
        x = z;
    }

    return y;
}

int mfpow(int x, int y, int m=MOD)
{
    int res = 1;

    while(y)
    {
        if(y&1LL)res = (res*x)%m;
        x = (x*x)%m;
        y >>= 1;
    }

    return res;
}

int invmod(int x, int m=MOD)
{
    return mfpow(x, m-2, m)%m;
}

