#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y) {
  long long res = 1;
  x = x % 1000000007;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = ((res % 1000000007) * (x % 1000000007)) % 1000000007;
    y = y >> 1;
    x = ((x % 1000000007) * (x % 1000000007)) % 1000000007;
  }
  return res;
}
vector<long long> pr;
void sieve(long long n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (long long p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (long long i = 2; i <= n; i++)
    if (prime[i]) pr.push_back(i);
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
void we_have_choices() {
  long long n, k, l;
  cin >> n >> k >> l;
  long long a[n + 1];
  for (long long i = 1; i <= n; i++) cin >> a[i];
  long long start = 0;
  long long extra = 0;
  for (long long i = 1; i <= n; i++) {
    extra = l - a[i];
    if (extra < 0) {
      cout << "No\n";
      return;
    }
    if (extra >= k)
      start = 0;
    else if (start < k)
      start = max(start + 1, k - extra);
    else if (start >= k) {
      ++start;
      if (start - k > extra) {
        cout << "No\n";
        return;
      }
    }
  }
  cout << "Yes\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  ;
  long long t;
  cin >> t;
  while (t--) we_have_choices();
  return 0;
}
