#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
  cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&...args) {
  const char *comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
const char nl = '\n';
const int inf = 2e9;
const ll INF = (ll)2e18;
const ll mod = 1e9 + 7;
const int N = 2e6 + 15;
int d[202], p[202];
int dp[202][202];
int n, k, l;
bool solve(int pos, int curTime) {
  if (pos > n) return true;
  if (pos > 0 and d[pos] + p[curTime] > l) return false;
  if (dp[pos][curTime] != -1) {
    return (bool)dp[pos][curTime];
  }
  dp[pos][curTime] = 0;
  for (int wait = 0; wait < 2 * k; ++wait) {
    if (pos == 0) {
      if (solve(pos + 1, (curTime + wait + 1) % (2 * k))) {
        dp[pos][curTime] = 1;
        break;
      }
    } else {
      if (d[pos] + p[(curTime + wait) % (2 * k)] > l) break;
      if (solve(pos + 1, (curTime + wait + 1) % (2 * k))) {
        dp[pos][curTime] = 1;
        break;
      }
    }
  }
  return (bool)dp[pos][curTime];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int tc;
  cin >> tc;
  while (tc--) {
    for (int i = 0; i < 202; ++i)
      for (int j = 0; j < 202; ++j) dp[i][j] = -1;
    cin >> n >> k >> l;
    for (int i = 1; i <= n; ++i) cin >> d[i];
    p[0] = 0;
    for (int i = 1; i <= k; ++i) p[i] = p[i - 1] + 1;
    for (int i = k + 1; i < 2 * k; ++i) p[i] = p[i - 1] - 1;
    bool ans = solve(0, 0);
    if (ans)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
