#include <bits/stdc++.h>
//#include <ext/rope>

using namespace std;
//using namespace __gnu_cxx;

/* DEBUG UTILITIES */
// outstream operator for pair
template <typename type_first, typename type_second>
ostream &operator << (ostream &out, const pair<type_first, type_second> P) {
  out << '{' << P.first << ',' << P.second << '}';
  return out;
}
// convert an iterable to a string that can be printed
template <typename type_iterator>
string ite2string(type_iterator begin, type_iterator end) {
  stringstream out;
  bool inserted = false;
  out << '[';
  while (begin != end) {
    out << *begin << ", ";
    inserted = true;
    begin++;
  }
  string ans = out.str();
  if (inserted) {
    ans.pop_back(); ans.pop_back();
  }
  return ans + ']';
}

#if DEBUG
  #define dbg_var(x) clog << #x << ": " << x << endl;
  #define dbg_arr(x, len) clog << #x << ": " << ite2string(x, x + len) << endl;
  #define dbg_ite(x) clog << #x << ": " << ite2string(x.begin(), x.end()) << endl;
  #define dbg_msg(x) clog << x << endl;
  ifstream input_from_file("input.txt");
  ofstream output_on_file("output.txt");
  //Comment next 2 lines for using IO with files during debug
  //#define cin input_from_file
  //#define cout output_on_file
#else
  #define dbg_var(x)
  #define dbg_arr(x, len)
  #define dbg_ite(x)
  #define dbg_msg(x)
  #define endl '\n'
#endif

/* SHORTCUTS */
#define forn(i, n) for (unsigned int i = 0; i < (unsigned int)(n); i++)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a).end()
#define st first
#define nd second
#define mp(a, b) make_pair(a, b)

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
/**********************************************************************/
/*                           END TEMPLATE                             */
/**********************************************************************/

bool solve() {
  int n, k;
  cin >> n >> k;
  vector<int> h(n);
  for (auto& i: h) {
    cin >> i;
  }
  int bas = h[0]+1, alt = h[0]+k;
  for (uint i = 1; i < n - 1; i++) {
    dbg_var(i);
    dbg_var(bas);
    dbg_var(alt);
    if(h[i] + 1 > alt or h[i] + 2*k - 1 < bas) {
      dbg_msg("impossible");
      return false;
    } else {
      if (h[i] > h[i+1]) {
        dbg_msg("down");
        bas = max(h[i] + 1, bas-k+1);
        alt = max(h[i] + k, alt-k+1);
      } else if (h[i] < h[i+1]) {
        dbg_msg("up");
        bas = min(h[i] + k, bas + k - 1);
        alt = min(h[i] + 2*k - 1, alt + k - 1);
      } else {
        bas = h[i] + 1;
        alt = h[i] + k;
      }
    }
  }
  dbg_msg("last block");
  dbg_var(bas);
  dbg_var(alt);
  if (h[n-1] + k < bas or h[n-1] + 1 > alt) {
    return false;
  }
  return true;
}

int main() {
  // IO optimizer. Comment if interactive problem
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr); cout.tie(nullptr);

  uint T;
  cin >> T;
  while(T--) {
    dbg_msg(endl);
    if (solve()) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }


  return 0;
}
