#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<math.h>
#define lli long long int
#define INF 999999999
#define mod 1000000007
using namespace std;


int main() {
	
 	ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

	int T;
	cin>>T;
	while(T--)
	{
		int N,K;
		cin>>N>>K;
		int A[N] ;
		for(int i =0;i<N;i++) cin>>A[i];
		
		vector<pair<int , int > > dp;
		dp.push_back(make_pair(A[0]-K+1,A[0]+K-1));
		int flag = 1;
		for(int i =1;i<N;i++)
		{
			if(i!= N-1)
			{
				if(A[i]>dp[i-1].second || A[i]+K-1<dp[i-1].first) 
				{
					flag = 0;
					break;
				}
				else
				{
					pair<int ,int > temp;
					int a = max(dp[i-1].first,A[i]);
					int b = min(dp[i-1].second,A[i] +K-1);
					temp.first = a-K+1;
					temp.second = b+K-1;
					dp.push_back(temp);
				}
			}
			else
			{
				if(A[i]>dp[i-1].second || A[i]<dp[i-1].first) 
				{
					flag = 0;
					break;
				}
			}
		}
		//for(int i =0;i<N-1;i++) cout<<dp[i].first<<" "<<dp[i].second<<endl;
		if(flag == 0) cout<<"NO\n";
		else cout<<"YES\n";
		
	}
  return 0;
}
