#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("avx,avx2,fma")
using namespace std;
long long power(long long a, long long b) {
  long long res = 1;
  a = a % 998244353;
  while (b > 0) {
    if (b & 1) {
      res = (res * a) % 998244353;
    }
    a = (a * a) % 998244353;
    b >>= 1;
  }
  return res;
}
long long fermat_inv(long long y) { return power(y, 998244353 - 2); }
long long gcd(long long a, long long b) { return (b == 0) ? a : gcd(b, a % b); }
const long long dx[] = {-1, 0, 1, 0, -1, 1, 1, -1};
const long long dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
void solve() {
  long long n, k, l;
  cin >> n >> k >> l;
  long long dep[n + 1];
  for (long long i = 0; i < n; i++) cin >> dep[i + 1];
  dep[0] = 0;
  vector<long long> safe;
  safe.push_back(0);
  for (long long i = 0; i < n; i++) {
    if (dep[i + 1] + k <= l) safe.push_back(i + 1);
  }
  safe.push_back(n + 1);
  bool ans = true;
  for (long long i = 1; i < (long long)safe.size() && ans; i++) {
    bool f = true;
    long long tide = k;
    for (long long j = safe[i - 1] + 1; j < safe[i]; j++) {
      tide += (f) ? -1 : 1;
      if (f) tide -= max(0LL, dep[j] + tide - l);
      if (tide < 0LL || tide + dep[j] > l) {
        ans = false;
        break;
      }
      if (tide == 0) f = false;
    }
  }
  if (ans)
    cout << "Yes\n";
  else
    cout << "No\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long T = 1;
  cin >> T;
  while (T--) {
    solve();
  }
  return 0;
}
