#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
using namespace std;
int main(void){
    int t;
    cin >> t;
    vector< int > h(200000);
    vector< int > mn(200000);
    vector< int > mx(200000);
    while(t--){
        int n, k;
        cin >> n >> k;
        for(int i = 0; i < n; i++) cin >> h[i];
        mn[0] = mx[0] = h[0]+1;
        bool flg = true;
        for(int i=1;i<n;i++){
            mn[i] = max(mn[i-1] - k + 1, h[i]+1);
            mx[i] = min(mx[i-1] + k - 1, h[i]+k);
            if(i == n-1) mx[i] = min(mx[i], h[i]+1);
            if(mx[i] < mn[i]){
                flg = false;
                break;
            }
        }
        puts(flg ? "YES" : "NO");
    }
}
