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

typedef long long ll;
typedef string str;
typedef double db;
typedef long double ld;

typedef pair<int, int> pi;
typedef  pair<ll, ll> pl;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pi> vpi;


#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define FR(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define RF(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

#define sz(x) int((x).size())
const int MAXN = (int)(2e5)+5;;
int H[MAXN];
int main() {
    cin.tie(0)->sync_with_stdio(0);
    int T;
    cin >> T;
    iter:
    while (T-->0) {
        int N, K;
        cin >> N >> K;
        FR(i, N) {
            cin >> H[i];
        }
        int l = H[0]-K+1;
        int r = H[0]+K-1;
        FOR(i, 1, N-1) {
            int l1 = H[i];
            int r1 = H[i]+K-1;
            l = max(l1, l);
            r = min(r1, r);
            if (r < l) {
                cout << "NO" << '\n';
                goto iter;
            }
            else {
                r += K-1;
                l -= K-1;
            }
        }
        if (l <= H[N-1] && H[N-1] <= r) {
            cout << "YES" << '\n';
        }
        else {
            cout << "NO" << '\n';
        }
    }
}
