#include <bits/stdc++.h>
using namespace std;
void printvector(std::vector<long long> v) {
  for (long long i = 0; i < v.size(); ++i) {
    cout << v[i] << " ";
  }
  cout << "" << endl;
}
void printarray(long long a[], long long n) {
  for (long long i = 0; i < n; ++i) {
    cout << a[i] << " ";
  }
  cout << "" << endl;
}
long long testcase = 1;
void solve() {
  long long n, k, l;
  cin >> n >> k >> l;
  long long d[n];
  for (long long i = 0; i < n; ++i) {
    cin >> d[i];
  }
  long long st[n], en[n];
  for (long long i = 0; i < n; ++i) {
    st[i] = l - d[i] + 1;
    en[i] = 2 * k - (l - d[i] + 1);
    if (st[i] <= 0) {
      cout << "No" << endl;
      return;
    }
    if (st[i] > k) {
      st[i] = -1;
      en[i] = -1;
    }
  }
  long long mod = 2 * k;
  bool free = true;
  long long t = 0;
  for (long long i = 0; i < n; i++) {
    if (st[i] == -1) {
      free = true;
    } else if (free) {
      t = (en[i] + 1) % mod;
      free = false;
    } else {
      if (st[i] <= (t + 1) % mod && (t + 1) % mod <= en[i]) {
        if (t < k) {
          cout << "No" << endl;
          return;
        } else {
          t = (en[i] + 1) % mod;
        }
      } else {
        t = (t + 1) % mod;
      }
    }
  }
  cout << "Yes" << endl;
  testcase++;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
}
