#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, k, l;
  cin >> n >> k >> l;
  int ans = 0;
  deque<int> d(2 * n);
  for (int i = 0; i < n; i++) {
    cin >> d[i];
    if (d[i] > l) ans = -1;
  }
  if (ans == -1) {
    cout << "NO\n";
    return;
  }
  pair<int, int> rng;
  rng = {-k, k};
  for (int i = 0; i < n; i++) {
    int diff = l - d[i];
    if (diff >= k)
      rng = {-k, k};
    else {
      rng = {max(rng.first + 1, -diff), min(rng.second + 1, diff)};
      if (rng.first > rng.second) {
        ans = -1;
      }
    }
  }
  if (ans == -1) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
