#include <bits/stdc++.h>
#pragma GCC optimize(2)
int read(void) {
  int res = 0, sign = 1;
  char ch = std::getchar();
  while (!std::isdigit(ch)) {
    if (ch == '-') sign = -1;
    ch = std::getchar();
  }
  while (std::isdigit(ch)) res = res * 10 + ch - 48, ch = std::getchar();
  return sign * res;
}
template <class Tp>
void write(const Tp &x) {
  if (x > 9) write(x / 10);
  std::putchar(x % 10 + 48);
}
const double PI = 3.1415926535898, E = 2.71828182845904;
namespace contest {
const int MAXN = 3e5 + 19;
int n, k, l;
int d[MAXN];
int pos[MAXN], cnt;
int main() {
  n = read(), k = read(), l = read();
  for (int i = 1; i <= n; ++i) d[i] = read();
  d[0] = -0x3f3f3f3f, d[n + 1] = -0x3f3f3f3f;
  cnt = 0;
  pos[++cnt] = 0;
  for (int i = 1; i <= n; ++i)
    if (d[i] + k <= l) pos[++cnt] = i;
  pos[++cnt] = n + 1;
  for (int i = 1; i < cnt; ++i) {
    int fail = 0, tot = 0;
    for (int r = 0; r <= k; ++r) {
      int tend = 0, delta;
      if (r != n) {
        ++tot;
        tend = 1, delta = r;
        for (int j = 1; pos[i] + j < pos[i + 1]; ++j) {
          delta += tend;
          if (delta == 0 || delta == k) tend = -tend;
          if (d[pos[i] + j] + delta > l) {
            ++fail;
            break;
          }
        }
      }
      if (r != 0) {
        ++tot;
        tend = -1, delta = r;
        for (int j = 1; pos[i] + j < pos[i + 1]; ++j) {
          delta += tend;
          if (delta == 0 || delta == k) tend = -tend;
          if (d[pos[i] + j] + delta > l) {
            ++fail;
            break;
          }
        }
      }
    }
    if (fail == tot) {
      std::puts("No");
      return 0;
    }
  }
  std::puts("Yes");
  return 0;
}
}  // namespace contest
int main() {
  for (int T = read(), i = 1; i <= T; ++i) contest::main();
  return 0;
}
