//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt,tune=native")

/*
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠋⠀⠀⠀⡧⠚⠉⠀⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡼
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⣰⠀⠀⠐⠀⣸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠁
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡷⠤⠤⢬⡀⠀⢀⣴⡷⠗⠚⣷⡤⠛⠉⠙⠮⡙⡄⠀⣸
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⠤⠔⠒⣒⡏⢀⣀⣀⡀⣿⠉⢅⠀⠐⠉⢠⢓⢤⡀⠀⠀⠀⠈⠂⠀⣿
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡤⠚⠁⠀⢀⣀⣐⣀⠀⠳⡇⠀⠀⠀⠀⠀⠀⢣⠀⡤⠧⢄⡀⠙⡓⢤⠀⠀⠀⠀⣿⢄⠀⠀⢠
⠀⣀⣀⣀⣀⣀⣀⣤⣀⠀⢀⠚⠚⠀⠦⡀⠠⣉⠉⠓⠀⠀⠀⠽⣄⠀⠀⠀⠀⠀⠀⡁⠀⠀⠀⠀⠀⠉⠙⣍⠙⠚⠉⢿⠉⢾
⠀⠈⢦⠠⠖⠂⠀⠀⠀⡳⠉⠁⠀⠀⠀⠀⢢⠀⠓⡀⠀⠀⠀⠀⠀⠑⠦⣒⣀⣀⣴⠜⠙⡛⠲⣀⣀⠀⠀⠁⡙⣄⡀⠘⡀
⠀⠀⠀⠙⢤⡀⠀⠀⣴⠀⠀⡇⠀⠀⠀⠀⠀⠹⡀⠀⢄⠀⠀⢀⠦⢠⠀⠀⠈⣄⠿⡇⢀⢹⠀⠀⠙⣄⣄⣀⠀⠢⠂⠉⢷
⠀⠲⣒⠒⡋⠄⡄⢠⠃⠀⠀⣇⠀⠀⠀⠀⠃⠀⠹⠳⡀⢦⡀⠀⠀⠀⠳⠀⠀⢎⣆⡇⠘⣸⡇⠀⠀⠀⠙⣀⢷⠀⠀⡄⠀⢧
⢤⠀⠀⠓⢤⣤⠤⣼⠀⠀⠀⠸⠀⠀⣄⠀⠀⠀⡀⢳⡉⠙⣞⣀⣄⠀⠀⠻⠀⢇⢘⡮⢢⣦⣧⠀⠀⠀⠀⠈⣯⠹⢦⣧⠀⠀⠳
⠀⣷⠀⠾⡵⣉⠀⣏⠀⠀⠀⠀⠹⠀⠈⠳⠀⠀⠈⣄⡖⠀⠀⣡⣶⢍⣟⠾⢳⢸⠀⠙⠀⡿⣷⣀⣀⣀⠀⡀⢸⠀⠀⠀⠀⠀⠀⠙
⠀⣿⠀⢸⠋⢸⠀⣿⠆⡀⢠⠀⠀⠘⣄⡀⠰⡀⠀⠈⡾⢫⣟⠖⣤⣸⡰⣧⠀⢿⣤⠀⠹⣷⢾⡉⢦⡀
⠀⠘⡦⠏⠀⢸⠀⢿⣦⠈⠀⠀⠀⡠⣅⠳⡀⠻⠆⠀⢹⠀⠈⠀⠈⠻⠿⠁⠀⠈⠀⡂⣇⢿⢦⠀⠦⡀⠀⠛⡭⠀⠀⠀⠀⠀⠀⣠
⠒⣡⢿⠀⠀⠀⡀⠸⡿⡰⠀⠀⡄⠀⢿⠀⠀⣒⣦⣃⠁⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⡟⢹⣆⣯⢿⡢⡀⡉⠉⠀⠀⠀⠀⠀⠀⠀⠙
⠒⠉⠉⣯⠉⠙⢳⢤⡿⠘⡀⢷⠀⠀⣾⠀⣷⢧⠤⢼⠦⢀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢿⠀⣏⢦⠳⢤⣀
⠀⠀⠀⢹⡄⠀⠀⡄⣿⡷⡀⠂⡽⣠⠛⣍⢦⣀⠈⠙⠁⠀⠀⠀⠀⠀⠔⠀⠀⢠⠋⠀⢧⠘⣶⠈⠙⠯⠀⣀⠤⠒⠒⢄
⠀⠀⠀⠀⣿⠀⠀⢻⠃⠀⠈⠀⠉⣄⠙⠋⠃⢻⡟⢮⠀⠀⠀⠀⠀⠀⠀⠀⡴⣁⠖⣩⢞⢦⣝⣟⠛⣉⠝⠊⢉⡀⠀⠀⠈⢄
⠀⠀⠀⠀⠘⣇⠴⢹⢄⠀⠀⠈⠀⠸⡓⠛⢶⡀⣇⠱⡈⠓⡲⡒⠺⡉⠁⠠⣫⢶⣁⠞⠉⠁⣀⣠⣾⠤⡀⠀⣿⢳⣀⡖⠙⢦⢻
⠀⠀⠀⢀⠖⢻⣄⣀⣿⣄⠀⠀⠹⢤⣘⢦⠀⣰⣽⠀⣽⠹⡇⠙⣄⠸⣦⣾⣒⠯⠒⠚⠛⣽⠋⠉⠢⠀⠈⠀⠀⠉⠷⡛⡁⡦⠒⢧
⠀⢀⠞⠀⠀⡟⡴⣚⠿⠑⠗⠄⣀⡇⠀⠀⠀⠳⡇⠀⠿⣀⠷⠒⠉⠀⠈⠙⡄⠀⠀⠀⢠⠷⡀⠀⠀⠀⣰⣄⡄⠀⠀⠙⣦⣾
⡴⠁⠀⠀⠀⡿⣠⢁⠞⣹⠀⠀⣀⡀⠀⠀⠀⠀⠀⠀⠀⣾⠀⠀⠀⠀⠀⠀⠀⠳⣀⠀⠀⠀⠀⠈⠙⢿⢝⣯⣍⠒⠐⡛⢓⢤⣯⡆
⠀⠀⠀⠀⠀⠻⡄⠈⠀⡷⠋⠀⠀⠈⠁⡇⠀⠀⠀⠀⠀⡿⠀⠀⠀⠀⠀⠀⣠⢋⠯⢯⠀⠀⡤⢻⠈⡄⠳⠀⣷⡀⠀⡴⡵⣕⣿⡣
⠀⠀⠀⠀⠀⠀⠀⠲⡞⠳⣄⠀⠀⠀⢠⡇⠀⠀⠀⠰⡾⠉⠞⠀⢳⠶⣤⢰⢠⡁⢦⠑⡷⣿⡴⡟⠀⢃⠀⣳⢳⢎⣤⡯⠋⠓⣿⡝
⠀⠀⠀⠀⠀⣠⠚⠉⠳⡀⠈⣷⣄⠀⠈⣻⡀⠀⠀⠀⡏⡅⠀⣤⠉⠑⣬⣿⡟⡈⠀⢹⠭⠥⣿⠥⣽⡭⢓⣉⠧⠳⣿⣿⣟⠲⢤⣷
*/

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

/* abbr */
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define srt(x) sort(all(x))
#define uni(x) sort(all(x)), x.erase(unique(all(x)), x.end())
#define msv(x, v) memset(x, v, sizeof(x))
#define ms(x) memset(x, 0, sizeof(x))
#define mc(x, y) memcpy(x, y, sizeof(y))

/* typedef for long long */

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;

/* typedef for other */

typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;

/* typedef for point */

//typedef pii point;
//#define x first
//#define y second

/* typedef for vector */

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

/* constant number */

const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const double PI = acos((long double) - 1.0);
const double EPS = 1e-10;
const int MOD = 1073741824;

template <typename T>
void cmin(T &x, T y) {
    if(y < x)
        x = y;
}

template <typename T>
void cmax(T &x, T y) {
    if(y > x)
        x = y;
}

#define dbg(x) cerr << #x " = " << (x) << endl

ll qpow(ll x, ll n, ll mod = MOD) {
    if(n < 0)
        return 0;
    ll res = 1;
    while(n) {
        if(n & 1)
            res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}

ll sq(ll x) {
    return x * x;
}

double sq(double x) {
    return x * x;
}

int n, k;
int h[200005];
int L[200005];
int R[200005];

namespace Solver {

    void InitOnce() {
#ifdef LOCAL
        freopen("A.txt", "r", stdin);
#endif // LOCAL
        int t;
        scanf("%d", &t);
    }

    void Read() {
        int res = scanf("%d%d", &n, &k);
        if(res == -1)
            exit(0);
        for(int i = 1; i <= n; ++i)
            scanf("%d", &h[i]);
    }

    void Solve() {
        L[1] = h[1];
        R[1] = h[1];
        for(int i = 2; i <= n; ++i) {
            L[i] = max(h[i], L[i - 1] + 1 - k);
            R[i] = min(h[i] + k - 1, R[i - 1] + k - 1);
            if(R[i] < L[i]) {
                puts("NO");
                return;
            }
        }
        if(L[n] > h[n] || R[n] < h[n]) {
            puts("NO");
            return;
        }
        puts("YES");
    }

}

int main() {
    Solver::InitOnce();
    while(true) {
        Solver::Read();
        Solver::Solve();
    }
    return 0;
}
