#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char* x) { cerr << '\"' << x << '\"'; }
void __print(const string& x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V>& x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T& x) {
  int f = 0;
  cerr << '{';
  for (auto& i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
void IO() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long int n, k, l;
int dp[105][202];
bool vis[105][202];
int tim[202];
vector<long long> a;
bool recFun(int x = 0, int t = 0) {
  if (x >= n + 1) return true;
  if (a[x] + tim[t] > l) return false;
  if (dp[x][t] != -1) return dp[x][t % (2 * k)];
  if (vis[x][t]) return false;
  vis[x][t] = 1;
  bool ans = recFun(x + 1, (t + 1) % (2 * k));
  ans |= recFun(x, (t + 1) % (2 * k));
  return dp[x][t] = ans;
}
void solve() {
  cin >> n >> k >> l;
  memset(dp, -1, sizeof(dp));
  memset(vis, 0, sizeof(vis));
  a.resize(n + 1);
  a[0] = INT_MIN;
  for (int i = 0; i < n; i++) cin >> a[i + 1];
  for (int i = 0; i < k; i++) {
    tim[i] = i;
    tim[k + k - i - 1] = i + 1;
  }
  if (recFun()) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
}
int main() {
  IO();
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
