# include <bits/stdc++.h>

# define All(a) (a).begin(),(a).end()

using namespace std;
using ll  = long long;
using ull = unsigned long long;
using ld  = long double;

int nxt();

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int t;
    cin >> t;

    while (t--) {
        ll n, k;
        cin >> n >> k;

        vector <ll> h(n), l(n), r(n);
        generate(All(h), nxt);

        l[0] = r[0] = h[0];
        string ans = "YES";
        for (int i=1; i<n; i++) {
            l[i] = max(h[i], l[i-1]-k+1);
            r[i] = min(h[i]+k-1, r[i-1]+k-1);

            if (l[i] > r[i]) {
                ans = "NO";
                break;
            }
        }

        if (ans == "YES" && ( h[n-1] <l[n-1] || h[n-1] > r[n-1])) {
            ans = "NO";
        }

        cout << ans << endl;
    }

    return 0;
}


//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


int nxt() {
    int x;
    cin >> x;
    return x;
}
