#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int p[2 * N], a[N], f[N][2 * N * N];
int n, k, l;
void init(int k) {
  for (int i = 0; i <= k; i++) p[i] = i;
  for (int i = 1; i < k; i++) p[i + k] = k - i;
  for (int j = 0; j < 2 * k * n; j++) f[0][j] = 1;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    memset(f, 0, sizeof f);
    cin >> n >> k >> l;
    for (int i = 1; i <= n; i++) cin >> a[i];
    init(k);
    for (int i = 1; i <= n; i++)
      for (int j = i; j <= 2 * k * n; j++) {
        f[i][j] = max(f[i][j - 1], f[i - 1][j - 1]);
        if (p[j % (2 * k)] + a[i] > l) f[i][j] = 0;
      }
    bool ok = false;
    for (int j = n; j <= 2 * k * n; j++)
      if (f[n][j]) {
        ok = true;
        break;
      }
    if (ok)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
