#include <bits/stdc++.h>
using namespace std;
inline int R() {
  char c;
  int sign = 1, res = 0;
  while ((c = getchar()) > '9' || c < '0')
    if (c == '-') sign = -1;
  res += c - '0';
  while ((c = getchar()) >= '0' && c <= '9') res = res * 10 + c - '0';
  return res * sign;
}
const int Maxn = 1e2 + 5;
int t, d[Maxn], n, k, l;
int main() {
  t = R();
  while (t--) {
    n = R();
    k = R();
    l = R();
    for (int i = 1; i <= n; i++) d[i] = R();
    int now = 0, pre = -1;
    while (1) {
      if (now <= pre) break;
      pre = now;
      for (int i = 0; i < k; i++) {
        if (d[now + 1] + i <= l || now >= n) {
          now++;
          if (now > n) break;
        } else
          while (d[now] + i > l && now > 0) now--;
      }
      for (int i = k; i >= 1; i--) {
        if (d[now + 1] + i <= l || now >= n) {
          now++;
          if (now > n) break;
        } else
          while (d[now] + i > l && now > 0) now--;
      }
      if (now >= n) break;
    }
    if (now >= n)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
