#include<bits/stdc++.h>
#define lld long long int
#define ulld unsigned long long
#define vll vector<lld>
#define pll pair<lld,lld>
#define mll map<lld,lld>
#define sll set<lld>
#define pb push_back
#define ss second
#define ff first
#define mp make_pair
#define MOD 1000000007 //998244353
#define answer(x) cout<<endl<<"answer : "<<x<<endl<<endl;
#define op(x) cout<<x<<endl;
#define MAXN 500005
#define lld_max 5000000000000000000
#define messi ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define REP(i,a,b) for(i=a;i<=b;i++)
#define rREP(i,a,b) for(i=a;i>=b;i--)
using namespace std;
int main() {messi lld t=1;cin>>t;
    while(t--)
    {
        lld n=0,m=0,k=0,i=0,j=0,p=0,q=0,x=0,y=0,z=0,ans=0,cnt=0,l=0,r=0,mid=0,lo=0,hi=0;string s;bool flag=false;
        cin>>n>>k; lld a[n]; REP(i,0,n-1) cin>>a[i];
        l = a[0], r =a[0]+ k; x = l; y = r;
        for(i=1;i<n-1;i++){
            l = max(a[i], l-(k-1));
            r = min(a[i]+k+k-1, r+k-1);
            if(l>r) swap(l,r);
            if(l>a[i]+k-1){
                flag = true;
                break;
            }
            if(r<a[i]){
                flag = true;
                break;
            }
            if(y<=l || x>=r){
                flag = true;
                break;
            }
            x = l;
            y = r;
        }
        if(a[n-1]+k <=l || a[n-1]>=r)
            flag = true;
        if(flag)
            cout<<"NO"<<endl;
        else
            cout<<"YES"<<endl;
    }
	return 0;
}
/*  CODED BY:-
 ________________________________________
|            __        __                |
|  /\   /\  |__)  /\  |  \ |__| \ /  /\  |
| /~~\ /~~\ |  \ /~~\ |__/ |  |  |  /~~\ |
|________________________________________|

*/
