#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const int MAXT = 1e4 + 1;
const long long INF = 1e9;
const long long MOD = 228228227;
inline void solve() {
  int n, k, l;
  cin >> n >> k >> l;
  vector<int> d(n);
  for (int &x : d) cin >> x;
  vector<int> p(2 * k);
  for (int i = 0; i < 2 * k; i++) p[i] = (i <= k ? i : k - (i - k));
  vector<vector<bool>> dp(n + 1, vector<bool>(MAXT));
  for (int t = 0; t < MAXT; t++) dp[0][t] = true;
  for (int x = 1; x < n + 1; x++) {
    for (int t = 1; t < MAXT; t++) {
      dp[x][t] = (dp[x][t - 1] || dp[x - 1][t - 1]) &&
                 (d[x - 1] + p[t % (2 * k)] <= l);
    }
  }
  for (int t = 0; t < MAXT; t++) {
    if (dp[n][t]) {
      cout << "Yes\n";
      return;
    }
  }
  cout << "No\n";
}
signed main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) solve();
}
