#include <bits/stdc++.h>

#define pb push_back
#define mp make_pair
#define sz(x) (int)(x).size()
#define S second
#define F first
#define all(x) (x).begin(), (x).end()

using namespace std;
using ll = long long;

void setIO(string name = "") {
	ios_base::sync_with_stdio(NULL);
	cin.tie(NULL);
	cout.tie(NULL);

	if (sz(name)) {
		freopen((name + ".in").c_str(), "r", stdin);
		freopen((name + ".out").c_str(), "w", stdout);
	}
}

const int inf = 1e9;
const ll INF = 1e18;
const int mod = 1e9 + 7;
const int MAXN = 1e6 + 5;

int n, k;
int h[MAXN];
int l[MAXN], r[MAXN];

void solve() {
	cin >> n >> k;
	
	for (int i = 1; i <= n; i++) {
		cin >> h[i];
	}
	
	l[1] = h[1] + 1;
	r[1] = k + h[1];
	for (int i = 2; i <= n; i++) {
		l[i] = max(l[i - 1] - k + 1, h[i] + 1);
		r[i] = min(r[i - 1] + k - 1, h[i] + 2 * k - 1);
		if (r[i] < l[i] || r[i] - l[i] + 1 < k) {
			cout << "NO\n";
			return;
		}
	
		//~ cout << l[i] << ' ' << r[i] << '\n';
	}
	
	if (l[n] == h[n] + 1) cout << "YES\n";
	else cout << "NO\n";
}

int main() {
	setIO();
	
	int tt = 1;
	cin >> tt;
	while (tt--) {
		solve();
	}
	
	return 0;
}
