#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const double EPS = 1e-8;
int n, k, l, d[110];
set<tuple<int, int, bool>> curr;
bool dfs(int i, int t, int inc) {
  if (i > n) return true;
  if (curr.find({i, t, inc}) != curr.end()) return false;
  curr.insert({i, t, inc});
  if (inc)
    ++t;
  else
    --t;
  if (t == 0) inc = true;
  if (t == k) inc = false;
  if (d[i] + t <= l && dfs(i, t, inc)) return true;
  if (d[i + 1] + t <= l && dfs(i + 1, t, inc)) return true;
  return false;
}
void test_case() {
  cin >> n >> k >> l;
  d[0] = -INF;
  d[n + 1] = -INF;
  for (int i = 1; i <= n; i++) cin >> d[i];
  curr.clear();
  if (dfs(0, 0, true))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  if (fopen("input.in", "r")) {
    freopen("input.in", "r", stdin);
    freopen("output.out", "w", stdout);
  }
  int t;
  cin >> t;
  while (t--) test_case();
  return 0;
}
