#include <bits/stdc++.h>
using namespace std;
int in(char &c) { return scanf("%c", &c); }
int in(char s[]) { return scanf("%s", s); }
int in(int &x) { return scanf("%d", &x); }
int in(long long &x) { return scanf("%lld", &x); }
int in(double &x) { return scanf("%lf", &x); }
int in(pair<int, int> &p) { return scanf("%d%d", &p.first, &p.second); }
int in(pair<long long, long long> &p) {
  return scanf("%lld%lld", &p.first, &p.second);
}
int in(pair<double, double> &p) { return scanf("%lf%lf", &p.first, &p.second); }
int in(long double &a) { return scanf("%Lf", &a); }
int in(int &x, long long &y) { return scanf("%d%lld", &x, &y); }
int in(long long &x, int &y) { return scanf("%lld%d", &x, &y); }
int in(int &x, int &y) { return scanf("%d%d", &x, &y); }
int in(long long &x, long long &y) { return scanf("%lld%lld", &x, &y); }
int in(char s[], int &n) { return scanf("%s%d", s, &n); }
int in(int &n, char s[]) { return scanf("%d%s", &n, s); }
int in(char a[], char b[]) { return scanf("%s%s", a, b); }
int in(double &x, double &y) { return scanf("%lf%lf", &x, &y); }
int in(int &n, char s[], char t[]) { return scanf("%d%s%s", &n, s, t); }
int in(int &x, int &y, int &z) { return scanf("%d%d%d", &x, &y, &z); }
int in(long long &x, long long &y, long long &z) {
  return scanf("%lld%lld%lld", &x, &y, &z);
}
int in(double &x, double &y, double &z) {
  return scanf("%lf%lf%lf", &x, &y, &z);
}
int in(int &x, int &y, int &z, int &k) {
  return scanf("%d%d%d%d", &x, &y, &z, &k);
}
int in(long long &x, long long &y, long long &z, long long &k) {
  return scanf("%lld%lld%lld%lld", &x, &y, &z, &k);
}
int in(double &x, double &y, double &z, double &k) {
  return scanf("%lf%lf%lf%lf", &x, &y, &z, &k);
}
const int N = 3e5 + 10, M = 1e3 + 10, mod = 1e9 + 7;
const double eps = 1e-6, Pi = acos(-1.0);
int a[N], k, l, n;
vector<int> vc;
int main() {
  int T;
  in(T);
  while (T--) {
    int flag = 0;
    vc.clear();
    vc.push_back(0);
    in(n, k, l);
    for (int i = 1; i <= n; i++) {
      in(a[i]);
      if (a[i] + k <= l) vc.push_back(i);
      if (a[i] > l) flag = 1;
    }
    if (flag) {
      printf("No\n");
      continue;
    }
    a[n + 1] = -0x3f3f3f3f;
    vc.push_back(n + 1);
    for (int i = 1; i < vc.size(); i++) {
      int tl = vc[i - 1] + 1, tr = vc[i];
      if (tr - tl > 2 * k) {
        flag = 1;
      }
      int beg = k - 1, op = 0;
      for (int j = tl; j <= tr; j++) {
        if (!op) {
          beg = min(beg, l - a[j]);
        }
        if (beg == -1) op = 1, beg = 1;
        if (op) {
          if (beg > l - a[j]) flag = 1;
        }
        if (!op)
          beg--;
        else
          beg++;
      }
    }
    if (flag) {
      printf("No\n");
    } else {
      printf("Yes\n");
    }
  }
  return 0;
}
