#include <bits/stdc++.h>
using namespace std;
const long long INF = LLONG_MAX;
const long long SZ = 2e2 + 5;
const long long mod = 1e9 + 7;
long long n, k, l;
long long d[SZ];
long long p[SZ];
long long dp[SZ][SZ];
bool solve(long long pos, long long t) {
  if (pos == n + 1) return 1;
  if (d[pos] + p[t] > l) return 0;
  if (dp[pos][t] != -1) return dp[pos][t];
  bool res(0);
  for (long long i = t;; i++) {
    if ((i % k == t % k && i != t) || (d[pos] + p[i % k] > l)) break;
    res |= solve(pos + 1, (i + 1) % k);
  }
  return dp[pos][t] = res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long cs = 0, tc = 1, x, y, z, i, j, g, q, ans = 0, sum = 0, c = 0, t = 0;
  string s, s1, s2;
  cin >> tc;
  while (tc--) {
    cin >> n >> k >> l;
    for (i = 1; i <= n; i++) cin >> d[i];
    for (i = 0; i <= k - 1; i++) p[i] = i;
    j = 0;
    for (i = (2 * k) - 1; i >= k; i--) p[i] = ++j;
    k *= 2;
    for (i = 0; i < n + 2; i++)
      for (j = 0; j < k + 2; j++) dp[i][j] = -1;
    ans = 0;
    for (i = 0; i < k; i++) ans |= solve(1, i);
    (ans) ? cout << "YES\n" : cout << "NO\n";
  }
  return 0;
}
