#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll h[200005], d[200005], u[200005];
int main()
{
    int t;
    scanf("%d", &t);
    while(t--)
    {
        ll n, k;
        scanf("%lld %lld", &n, &k);
        for(int i=1; i<=n; i++)
        {
            scanf("%lld", &h[i]);
            d[i]=h[i];
            u[i]=h[i]+k-1;
        }
        int f=0;
        u[1]=h[1];
        u[n]=h[n];
        for(int i=1; i<n; i++)
        {
            if(u[i]<d[i+1])
            {
                if(u[i]+k-1>=d[i+1]) u[i+1]=u[i]+k-1;
                else
                {
                    f=1;
                    break;
                }
            }
            if(d[i]>u[i+1])
            {
                if(d[i]-k+1<=u[i+1])
                {
                    d[i+1]=d[i]-k+1;
                }
                else
                {
                    f=1;
                    //printf("%d..%d %d\n", i, d[i]);
                    break;
                }
            }
        }

        if(f)
        {
            printf("NO\n");
        }
        else
        {
            puts("YES");
        }
    }
}
