#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 2e5 + 10;
int a[N];
int b[N];
int main() {
	int t;
	cin >> t;
	while(t --) {
		memset(a, 0, sizeof a);
		memset(b, 0, sizeof b);
		int n, k;
		cin >> n >> k;
		for(int i = 1; i <= n; i ++) cin >> a[i]; 
	    int f = 0;
	    int p = a[1] + k - 1;
	    int q = a[1]; 
		b[1] = a[1];
	    for(int i = 2; i <= n; i ++) {	 
		    int l, r;
		    l = min(a[i] + 2 * k - 2, p + k - 1);
		    r = max(a[i], q - k + 1);
		    p = l;
		    q = r; 
		    if(l - k + 1 < a[i]) f = 1;
		    else {
		    	if(r > a[i] + k - 1) f = 1;
		    	else if(l < r) f = 1;
			} 
	    }
	    if(q != a[n]) f = 1;
	    if(f) cout << "NO" << endl;
	    else cout << "YES" << endl;
	}
	return 0;
}