#include <bits/stdc++.h>
using namespace std;
const long long INF = 2000000000000000000LL;
const int inf = 0x3f3f3f3f;
long long MOD = 1e9 + 7;
const long double EPS = 1e-9;
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline double my_sqrt(T n) {
  double high = n, low = 0, mid, ans;
  int cnt = 100;
  while (cnt--) {
    mid = low + (high - low) / 2;
    if (mid * mid <= n)
      ans = mid, low = mid;
    else
      high = mid;
  }
  return ans;
}
template <class T>
inline T bigmod(T b, T p) {
  if (p <= 0) return 1;
  if (p & 1) return (b * bigmod(b, p - 1)) % MOD;
  long long x = bigmod(b, p >> 1);
  return (x * x) % MOD;
}
int main() {
  long long test;
  scanf("%lld", &test);
  ;
  while (test--) {
    long long n, k, l;
    scanf("%lld%lld%lld", &n, &k, &l);
    ;
    vector<long long> v(n);
    for (long long i = 0; i < n; i++) scanf("%lld", &v[i]);
    ;
    long long now, t = 0, ck = 0, r = 1;
    now = v.front();
    if (now > l) ck = 1;
    t = l - now;
    r = 0;
    if (t < 0) ck = 1;
    if (t > k) t = 0;
    if (t == 0) r = 1;
    for (int i = 0; i < n - 1; i++) {
      now = v[i];
      if (now + t > l) {
        ck = 1;
        break;
      }
      if (now + k <= l) {
        t = l - v[i + 1];
        r = 0;
        if (t < 0) ck = 1;
        if (t > k) t = 0;
        if (t == 0) r = 1;
      } else {
        if (r == 0) {
          long long lt = t;
          if (v[i + 1] + t - 1 <= l)
            t--;
          else {
            t = l - v[i + 1];
            if (t < 0) ck = 1;
            if (t > k) t = 0;
          }
        } else
          t++;
        if (t == 0) r = 1;
      }
    }
    now = v.back();
    if (now > l || now + t > l) ck = 1;
    if (ck == 0)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
