#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
long long int power(long long int x, long long int y) {
  x %= mod;
  if (y == 0) return 1;
  return ((y % 2 == 1 ? x : 1) * power(x * x, y / 2));
}
vector<long long int> primeNumbers;
void SieveOfEratosthenes(int n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  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]) {
      primeNumbers.push_back(p);
    }
  }
}
vector<vector<long long int> > v(1005);
void pre() {}
void solve() {
  long long int n, k, l;
  cin >> n >> k >> l;
  long long int d[n + 1];
  d[0] = 0;
  vector<int> safe = {0};
  for (int i = 1; i <= n; i++) {
    cin >> d[i];
    if (d[i] + k <= l) {
      safe.push_back(i);
    }
  }
  safe.push_back(n + 1);
  for (int i = 0; i < safe.size() - 1; i++) {
    bool down = true;
    long long int tide = k;
    for (int j = safe[i] + 1; j < safe[i + 1]; j++) {
      tide += (down ? -1 : 1);
      long long int currentMaxTide = l - d[j];
      if (currentMaxTide < 0) {
        cout << "No";
        return;
      }
      if (tide > currentMaxTide && down) {
        tide = currentMaxTide;
      }
      if ((tide > currentMaxTide && !down) || (tide + d[j] > l)) {
        cout << "No";
        return;
      }
      if (tide == 0) down = false;
    }
  }
  cout << "Yes";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  pre();
  while (t--) {
    solve();
    if (t > 0) {
      cout << '\n';
    }
  }
  cerr << "Time : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n";
  return 0;
}
