#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, k, l;
  cin >> n >> k >> l;
  vector<long long> d(n + 1);
  bool ok = true;
  vector<long long> safe;
  safe.push_back(0);
  for (long long i = 1; i < n + 1; i++) {
    cin >> d[i];
    if (d[i] + k <= l) safe.push_back(i);
    if (d[i] > l) ok = false;
  }
  safe.push_back(n + 1);
  if (!ok) {
    cout << "NO" << endl;
    return;
  }
  for (long long i = 0; i < safe.size() - 1 && ok; i++) {
    bool down = true;
    long long tide = k;
    for (long long j = safe[i] + 1; j < safe[i + 1]; j++) {
      if (down)
        tide--;
      else
        tide++;
      if (down) {
        long long excess = max(0ll, d[j] + tide - l);
        tide -= excess;
      }
      if (tide < 0 || d[j] + tide > l) {
        ok = false;
        break;
      }
      if (tide == 0) down = false;
    }
  }
  if (ok) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
}
