#include <bits/stdc++.h>
using namespace std;
vector<int> a;
int n, k, l;
bool comp(int x, int y) {
  int pos = -1;
  bool f = false;
  for (int i = x + 1; i < y; ++i) {
    if (f == false) {
      pos = max(pos + 1, 2 * k - (l - a[i]));
      if (pos == 2 * k) pos = 0, f = true;
    } else {
      pos++;
      if (pos + a[i] > l) return false;
    }
  }
  return true;
}
void solve() {
  cin >> n >> k >> l;
  a = vector<int>(n + 2, -k);
  for (int i = 1; i <= n; ++i) cin >> a[i];
  if (*max_element(a.begin(), a.end()) > l) {
    cout << "NO\n";
    return;
  }
  int b = 0;
  for (int i = 1; i < n + 2; ++i) {
    if (a[i] + k <= l) {
      if (!comp(b, i)) {
        cout << "NO\n";
        return;
      }
      b = i;
    }
  }
  cout << "YES\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T = 1, tc = 1;
  cin >> T;
  while (T--) {
    solve();
  }
  return 0;
}
