#include <bits/stdc++.h>
#define mod 1000000007
#define int long long
#define pi 2 * acos(0.0)

using namespace std;

void fun()
{
    ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

/* -------------The way to get started is to quit talking and begin doing ------------- */

void solve()
{
    fun();
    int t = 1;
    cin >> t;
    while (t--)
    {
        int n, k;
        cin >> n >> k;

        int h[n];
        for (auto &i : h)
            cin >> i;
        int l = h[0], r = h[0];
        bool ok = true;
        for (int i = 1; i < n; i++)
        {
            int l1 = max(l - (k - 1), h[i]), r1 = min(r + (k - 1), h[i] + k - 1);
            if (l1 > r1 || (i == (n - 1) && (h[i] < l1 || h[i] > r1)))
            {
                ok = false;
                break;
            }
            l = l1, r = r1;
        }

        if (ok)
            cout << "YES\n";
        else
            cout << "NO\n";
    }
}

signed main()
{
    solve();

    return 0;
}