#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int T = clock();
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, k, l;
    cin >> n >> k >> l;
    vector<long long int> a(n), f(n);
    bool fq = true;
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] > l) fq = false;
    }
    if (!fq) {
      cout << "No\n";
      continue;
    }
    for (long long int i = 0; i < n; i++) {
      if (a[i] + k <= l) f[i] = 1;
    }
    bool ok = true;
    long long int st = 0;
    while (st < n) {
      while (st < n && f[st] == 1) st++;
      if (st == n) break;
      long long int val = k, inc = 0;
      while (st < n && f[st] == 0) {
        long long int ex = l - a[st];
        if (inc == 1 && val > ex) {
          ok = false;
          break;
        }
        val = min(val, ex);
        if (val == 0) inc = 1;
        st++;
        if (inc)
          val++;
        else
          val--;
      }
      if (!ok) break;
    }
    if (ok)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  cerr << "\n\nTIME: " << (double)(clock() - T) / CLOCKS_PER_SEC << " sec\n";
  T = clock();
  return 0;
}
