#include <bits/stdc++.h>

using namespace std;
using ll = long long;

/// edit everything

int main() {

    int t;
    cin >> t;

    while(t--){

        int n, k;
        cin >> n >> k;

        vector<int> h(n);
        for(int &i : h) cin >> i;

        vector<pair<int, int> > p(n);
        p[0] = {h[0], h[0]};
        p[n-1] = {h[n-1], h[n-1]};
        for(int i = 1; i < n-1; i++){
            p[i] = {h[i], h[i]+k-1};
        }

        bool ok = 1;

        for(int i = 1; i < n; i++){
            if(p[i].first >= p[i-1].second+k){
                ok = 0;
                break;
            }
            if(p[i].second + k <= p[i-1].first){
                ok = 0;
                break;
            }
            p[i].first = max(p[i].first, p[i-1].first-(k-1));
            p[i].second = min(p[i].second, p[i-1].second+k-1);
        }

        cout << (ok ? "YES" : "NO") << endl;

    }

    return 0;
}
