#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, k, l;
  cin >> n >> k >> l;
  vector<long long> d(n);
  int i;
  for (i = 0; i < n; i++) cin >> d[i];
  long long ph = k + 1;
  long long status(0);
  for (i = 0; i < n; i++) {
    if (d[i] + k <= l) {
      ph = k + 1;
      status = 0;
    } else {
      if (ph == k) {
        ph--;
        status = 0;
      } else if (ph == 0) {
        ph++;
        status = 1;
      } else {
        if (status == 0)
          ph--;
        else
          ph++;
      }
      long long cnt = min(ph, l - d[i]);
      if (cnt < 0 || (cnt < ph && status == 1)) {
        cout << "No" << endl;
        return;
      }
      ph = min(ph, cnt);
    }
  }
  cout << "Yes" << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    solve();
  }
}
