#include <bits/stdc++.h>
using namespace std;
long long int binomialCoeff(long long int n, long long int k) {
  long long int res = 1;
  if (k > n - k) k = n - k;
  for (int i = 0; i < k; ++i) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
long long int power(long long int x, long long int y) {
  long long int temp;
  if (y == 0) return 1;
  temp = power(x, y / 2);
  if (y % 2 == 0)
    return temp * temp;
  else
    return x * temp * temp;
}
vector<long long int> primes;
void Sieve(int n) {
  vector<bool> prime(n + 1, true);
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (int p = 2; p <= n; p++)
    if (prime[p]) primes.push_back(p);
}
const int Nmax = 4e5 + 6;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long int n, k, l;
    cin >> n >> k >> l;
    long long int arr[n];
    bool ans = true;
    long long int r[n];
    memset(r, 0, sizeof(r));
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      if (arr[i] > l) {
        ans = false;
      }
    }
    if (!ans) {
      cout << "No\n";
      continue;
    }
    long long int low = -1e12;
    long long int high = 1e12;
    for (int i = 0; i < n; i++) {
      if (arr[i] + k <= l) {
        low = -1e12;
        high = 1e12;
        continue;
      }
      low = max(arr[i] - l + i, low);
      high = min(l - arr[i] + i, high);
      if (low > high) {
        ans = false;
        break;
      }
    }
    if (ans)
      cout << "Yes";
    else
      cout << "No";
    cout << "\n";
  }
}
