#include<bits/stdc++.h>
#define ll long long int
#define mk make_pair
#define pb push_back
#define INF (ll)1e18
#define pii pair<ll,ll>
#define mod 1000000007 //998244353
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fb(i,a,b) for(ll i=a;i>b;i--)
#define ff first
#define ss second
#define srt(v)  if(!v.empty())sort(v.begin(),v.end())
#define rev(v)  if(!v.empty())reverse(v.begin(),v.end())
#define PI 3.141592653589793238
#define pqr priority_queue<ll,vector<ll>,greater<ll>()>
using namespace std;
ll pow_mod(ll a,ll b)
{
	ll res=1;
	while(b!=0)
	{
		if(b&1)
		{
			res=(res*a)%mod;
		}
		a=(a*a)%mod;
		b/=2;
	}
	return res;
}
void solve()
{
   ll n,k;
   cin>>n>>k;
   
   ll h[n];
   
   for(ll i=0;i<n;i++)
   cin>>h[i];
   
   ll  val[n];
   
  bool mark[n];
  
  memset(mark,false,sizeof(mark));
  
  set<pii>st;
  
  for(ll i=0;i<n;i++)
  st.insert(mk(h[i],i));
  
 // srt(v);
  
  while(!st.empty()){
      pii x=*st.rbegin();
      st.erase(x);
      
      ll id=x.ss;
      
      ll cur_ht=x.ff;
      
      if(id-1>=0&&id!=1){
          if(!mark[id-1]){
              mark[id-1]=true;
              ll ras=0;
              ras=max(ras,h[id]+1-k);
              ll dif=max(0LL,ras-h[id-1]);
              
              if(dif>k-1){
                  cout<<"NO\n";
                  return;
              }
              
              st.erase({h[id-1],id-1});
              
              h[id-1]+=dif;
              
              st.insert({h[id-1],id-1});
          }
      }
      
      if(id+1<n&&id+1!=n-1){
          if(!mark[id+1]){
              mark[id+1]=true;
               ll ras=0;
              ras=max(ras,h[id]+1-k);
              ll dif=max(0LL,ras-h[id+1]);
              
              if(dif>k-1){
                  cout<<"NO\n";
                  return;
              }
              
              st.erase({h[id+1],id+1});
              
              h[id+1]+=dif;
              
              st.insert({h[id+1],id+1});
              
          }
      }
  }
  
  
  for(ll i=1;i<n;i++){
      ll l1=h[i];
      ll r1=h[i]+k;
      
      ll l2=h[i-1];
      ll r2=h[i-1]+k;
      
      if(l2>=r1||r2<=l1){
          cout<<"NO\n";
          return;
      }
  }
  
  cout<<"YES\n";
}
int main()
{    ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);
     
//Start from Here.

  ll t;
  t=1;
  cin>>t;
  while(t--)
  solve();
  
//Good Bye!
    return 0;
}