#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e2 + 17;
const int MOD = 1e9 + 7;
int f[MAXN][2 * MAXN];
int main(int argc, char const *argv[]) {
  int T;
  cin >> T;
  while (T--) {
    memset(f, 0, sizeof(f));
    int n, k, l;
    cin >> n >> k >> l;
    vector<int> v(n + 2);
    for (int i = 0; i < n; ++i) cin >> v[i + 1];
    v[n + 1] = -10000000;
    for (size_t i = 0; i < 2 * k; i++) {
      f[0][i] = 1;
    }
    for (size_t i = 1; i <= n + 1; i++) {
      for (size_t j = 0; j < 2 * k; j++) {
        int add = j <= k ? j : (2 * k - j);
        if (v[i] + add > l)
          f[i][j] = 0;
        else if (j == 0)
          f[i][j] = f[i - 1][2 * k - 1];
        else {
          f[i][j] = f[i - 1][j - 1] || f[i][j - 1];
          if (j == 2 * k - 1) f[i][0] |= f[i][j];
        }
      }
    }
    bool can = false;
    for (size_t t = 0; t < 2 * k; t++) {
      if (f[n + 1][t]) can = true;
    }
    if (!can)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
  return 0;
}
