#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, k, l;
  cin >> n >> k >> l;
  vector<int> d(n);
  for (int i = 0; i < n; ++i) cin >> d[i];
  int down = 1;
  int val = k;
  for (int i = 0; i < n; ++i) {
    if (d[i] > l) {
      cout << "NO" << endl;
      return;
    }
    if (d[i] + k <= l) {
      down = 1;
      val = k;
    } else {
      if (down == 1) {
        val = min(val - 1, l - d[i]);
        if (val == 0) {
          down = 0;
        }
      } else {
        val++;
        if ((val + d[i]) > l) {
          cout << "NO" << endl;
          return;
        }
      }
    }
  }
  cout << "YES" << endl;
}
int main() {
  ios_base::sync_with_stdio(1);
  cin.tie(0), cout.tie(0);
  long long t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    solve();
  }
}
