#include <bits/stdc++.h>
using namespace std;
long long int mod = 998244353, n, m, k;
void solve() {
  long long int d;
  cin >> n >> k >> d;
  vector<long long int> safe, a(n);
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] + k <= d) {
      safe.push_back(i);
    }
  }
  safe.push_back(n);
  long long int last_safe = 0;
  for (auto x : safe) {
    long long int tide = k, up = -1;
    for (long long int i = last_safe; i < x; i++) {
      tide += up;
      if (up == -1) {
        tide -= max((long long int)0, a[i] + tide - d);
      }
      if (tide < 0 || a[i] + tide > d) {
        cout << "NO\n";
        return;
      }
      if (tide == 0) up = 1;
    }
    last_safe = x + 1;
  }
  cout << "YES\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
