#include <bits/stdc++.h>
using namespace std;
template <typename T>
void printv(vector<T> v) {
  for (auto e : v) {
    cout << e << " ";
  }
  cout << "\n";
}
template <typename T>
void printvv(vector<T> vv) {
  for (long long i = 0; i < vv.size(); i++) {
    cout << i << ": ";
    for (auto e : vv[i]) {
      cout << e << " ";
    }
    cout << "\n";
  }
}
long long t, n, k, l;
vector<long long> d, p;
vector<vector<long long>> table, check;
void dfs(long long i, long long j) {
  check[i][j] = 1;
  long long nexti = (i + 1) % (2 * k);
  if (table[nexti][j] >= 0 && check[nexti][j] == 0) dfs(nexti, j);
  if (table[nexti][j + 1] >= 0 && check[nexti][j + 1] == 0) dfs(nexti, j + 1);
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> t;
  while (t--) {
    cin >> n >> k >> l;
    d.resize(n + 1);
    for (long long i = 1; i <= n; i++) cin >> d[i];
    p.resize(0);
    for (long long i = 0; i <= k; i++) p.push_back(i);
    for (long long i = k - 1; i > 0; i--) p.push_back(i);
    vector<vector<long long>> tempvvi(2 * k, vector<long long>(n + 1));
    table = check = tempvvi;
    for (long long i = 0; i < 2 * k; i++) {
      for (long long j = 1; j <= n; j++) {
        table[i][j] = l - d[j] - p[i];
      }
    }
    for (long long i = 0; i < 2 * k; i++) {
      if (table[i][1] >= 0) dfs(i, 1);
    }
    bool arrive = false;
    for (long long i = 0; i < 2 * k; i++) {
      if (check[i][n] == 1 && table[i][n] >= 0) arrive = true;
    }
    cout << (arrive ? "Yes" : "No") << "\n";
  }
  return 0;
}
