// Never gonna give you up
// Never gonna let you down
// Never gonna run around and desert you
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout <<(#x)<<" is "<<(x)<<endl
#define debug cout <<"hi"<<endl
#define fi first
#define se second
#define pf push_front
#define pb push_back
#define sz(a) a.size()
#define all(a) a.begin(),a.end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

void solve(){
    int n,k; cin >>n >>k;
    int h[n]; for(auto &i:h) cin >>i;
    int mn=h[0],mx=h[0];
    for(int i=1; i<n; i++){
        mn=max(mn-k+1,h[i]);
        mx=min(mx,h[i])+k-1;
        if(mn>mx) break;
    }
    cout <<(mn>mx||mn>h[n-1]?"NO":"YES")<<'\n';
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int T; cin >>T; while(T--)
    solve(); return 0;
}