#include <bits/stdc++.h>
using namespace std;
long long int pow_mod(long long int a, long long int b) {
  long long int res = 1;
  while (b != 0) {
    if (b & 1) {
      res = (res * a) % 1000000007;
    }
    a = (a * a) % 1000000007;
    b /= 2;
  }
  return res;
}
void solve() {
  long long int n, k, l;
  cin >> n >> k >> l;
  long long int d[n];
  for (long long int i = 0; i < n; i++) {
    cin >> d[i];
  }
  long long int p[2 * k];
  for (long long int i = 0; i < k; i++) p[i] = i;
  for (long long int i = k; i < 2 * k; i++) p[i] = 2 * k - i;
  long long int depth[2 * k][n];
  for (long long int i = 0; i < 2 * k; i++) {
    for (long long int j = 0; j < n; j++) {
      depth[i][j] = d[j] + p[i];
    }
  }
  long long int dp[2 * k + 1][n + 3];
  for (long long int i = 0; i < 2 * k; i++) {
    for (long long int j = 0; j < 2 * k; j++) {
      for (long long int p = 0; p < n; p++) {
        long long int x = (j + i) % (2 * k);
        if (depth[x][p] <= l)
          dp[j][p] = 1;
        else
          dp[j][p] = 0;
      }
    }
    if (dp[0][0] == 0) continue;
    for (long long int p = 0; p < n; p++) {
      for (long long int j = 0; j < 2 * k; j++) {
        if (dp[j][p] == 0) continue;
        if (j > 0 && p > 0 && dp[j - 1][p] == 0 && dp[j - 1][p - 1] == 0)
          dp[j][p] = 0;
        else if (j == 0 && p > 0 && dp[2 * k - 1][p - 1] == 0)
          dp[j][p] = 0;
        else if (p == 0 && j > 0 && dp[j - 1][p] == 0)
          dp[j][p] = 0;
      }
    }
    for (long long int j = 0; j < 2 * k; j++)
      if (dp[j][n - 1] == 1) {
        cout << "Yes\n";
        return;
      }
  }
  cout << "No\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
