#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(int argc, char const *argv[]){
	ll t;
	cin >> t;
	for(ll z = 0; z < t; z++){
		ll n, k;
		bool res = true;
		cin >> n >> k;
		ll arr[n];
		for(ll i = 0; i < n; i++)
			cin >> arr[i];

		ll cur_min = arr[0] - (k - 1), cur_max = arr[0] + k - 1;
		for(ll i = 1; i < n; i++){
			ll mini = arr[i], maxi = arr[i] + k - 1;
			if(i == n - 1)
				mini = maxi = arr[i];
			if(maxi < cur_min or cur_max < mini){
				res = false;
				break;
			}
			cur_min = max(cur_min, mini); cur_max = min(cur_max, maxi);
			cur_min -= (k - 1); cur_max += (k - 1);
		}
		if(res)
			cout << "YES\n";
		else
			cout << "NO\n";
	}
	return 0;
}