#include <bits/stdc++.h>
using namespace std;
bool fun(vector<long long> &a, long long start, long long end, long long l,
         long long k) {
  long long siz = end - start + 1;
  if (siz >= 2 * k) return false;
  long long tide = l - a[start];
  bool up = false;
  for (long long i = start; i <= end; i++) {
    if (a[i] + tide <= l) {
      if (i + 1 <= end) {
        if (!up) {
          if (l - a[i + 1] < tide)
            tide = l - a[i + 1];
          else if (tide - 1 >= 0)
            tide--;
          else {
            tide = tide > 0 ? -1 : 0;
            up = true;
          }
        }
        if (up) tide++;
      }
    } else
      return false;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n, k, l;
    cin >> n >> k >> l;
    vector<long long> a(n);
    bool ans = true;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] > l) ans = false;
    }
    if (!ans) {
      cout << "No\n";
      continue;
    }
    long long i = 0, j = 0;
    while (j < n) {
      while (i < n && a[i] + k <= l) i++;
      if (i == n) break;
      j = i;
      while (j < n && a[j] + k > l) j++;
      if (!fun(a, i, j - 1, l, k)) {
        ans = false;
        break;
      }
      i = j;
    }
    if (ans)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
