#include <bits/stdc++.h>
#define ll long long
#define fore(i,a,b) for(int i=a;i<b;i++)
#define mp make_pair
#define vll vector<ll>
#define vvll vector<vll>
#define vi vector<int>
#define vvi vector<vi>
#define fst first
#define snd second
#define sz(x) int(x.size())
#define all(x) x.begin(),x.end()
#define pb push_back
#define pii pair<int,int>
#define FIFO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define RFWF freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
using namespace std;

int main() {
	int t;
	cin>>t;
	while(t--){
	    int n,k;
	    cin>>n>>k;
	    vi h(n);
	    fore(i,0,n) cin>>h[i];
	    int l=h[0],r=h[0]+k;
	    bool ans=true;
	    fore(i,1,n){
	        if((l-(k-1))>(h[i]+k-1)) {
	            ans=false;
	            break;
	        }
	        if(r<=h[i]){
	            ans=false;
	            break;
	        }
	        l=max(l-(k-1),h[i]);
	        r=min(r+k-1,h[i]+k+k-1);
	    }
	    if(l!=h[n-1]) ans=false;
	    if(ans) cout<<"YES"<<endl;
	    else cout<<"NO"<<endl;
	}
	return 0;
}