#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long tests;
  cin >> tests;
  while (tests--) {
    long long n, k, l;
    cin >> n >> k >> l;
    vector<long long> dep(n + 1), safe = {0};
    for (long long i = 1; i <= n; i++) {
      cin >> dep[i];
      if (dep[i] + k <= l) safe.push_back(i);
    }
    safe.push_back(n + 1);
    bool ok = true;
    for (long long i = 0; i < safe.size() - 1 and ok; i++) {
      long long tide = k;
      bool down = true;
      for (long long j = safe[i] + 1; j < safe[i + 1]; j++) {
        tide += down ? -1 : 1;
        if (down) tide -= max(0LL, dep[j] + tide - l);
        if (tide < 0 or dep[j] + tide > l) {
          ok = false;
          break;
        }
        if (!tide) down = false;
      }
    }
    if (ok)
      cout << "Yes" << '\n';
    else
      cout << "No" << '\n';
  }
  return 0;
}
