#include <bits/stdc++.h>
const long long INF = 1e18;
void swap(long long &a, long long &b) {
  long long temp;
  temp = a;
  a = b;
  b = temp;
}
using namespace std;
void solve() {
  long long n, k, l, d[300000], safe[300000] = {0}, low = 1;
  cin >> n >> k >> l;
  for (int i = 0; i < n; i++) {
    cin >> d[i];
    if (d[i] + k <= l) safe[i] = 1;
  }
  for (long long i = 0, tide = k; i < n; i++) {
    if (safe[i] == 1) {
      low = 1;
      tide = k;
    } else {
      if (low)
        tide--;
      else
        tide++;
      if (low) tide = min(tide, l - d[i]);
      if (tide < 0 || tide + d[i] > l) {
        cout << "No";
        return;
      }
      if (tide == 0) low = 0;
    }
  }
  cout << "Yes";
}
int main() {
  int t;
  t = 1;
  cin >> t;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
