#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

#define pii pair<int, int>

void testCase() {
    int n, k;
    cin >> n >> k;
    int groundHeight [n];
    for (int i = 0; i < n; i++) cin >> groundHeight[i];
    pii pos [n];
    pos[0].first = groundHeight[0];
    pos[0].second = groundHeight[0];
    for (int i = 1; i < n; i++) {
        if (groundHeight[i]+k-1+k <= pos[i-1].first or pos[i-1].second+k <= groundHeight[i]) {
            cout << "NO\n";
            return;
        }
        pos[i].first = max(pos[i-1].first-k+1, groundHeight[i]);
        pos[i].second = min(pos[i-1].second+k-1, groundHeight[i]+k-1);
    }
    if (pos[n-1].first > groundHeight[n-1]) {
        cout << "NO\n";
        return;
    }
    cout << "YES\n";
    return;
}

int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) testCase();
    int dummy = 0;
    dummy++;
}