#include <bits/stdc++.h>
using namespace std;
int main()
{
  int t;
  cin>>t;
  //cout<<max(6,78)<<endl<<endl;
  while(t--)
  {
    int flag=0;
    long long int n,k,x;
    cin>>n>>k;
    long long int height[n],max_pos,min_pos; 
    for(x=0;x<n;x++)
    {
      cin>>height[x];
    }
    max_pos=height[0];
    min_pos=height[0];
    for(x=1;x<n;x++)
    {
      if(height[x]>max_pos+k-1)
      {
        flag=1;
        break;
      }
      else if(height[x]+k-1+k-1<min_pos)
      {
        flag=1;
        break;
      }
      else
      {
        if(height[x]>=height[x-1]){
        min_pos=height[x];
        max_pos=min(max_pos+k-1,height[x]+k-1);
        }
        else
        {
          max_pos=height[x]+k-1;
          min_pos=max(min_pos-k+1,height[x]);
        }
      }
    //  cout<<min_pos<<" "<<max_pos<<endl;
    }
    if(min_pos!=height[n-1])
    {
      flag=1;
    }
    if(flag)
    {
      cout<<"NO"<<endl;
    }
    else
    {
      cout<<"YES"<<endl;
    }
  }
}