#include <bits/stdc++.h>
#pragma GCC optimize "03"
const long long int MOD = 1e9 + 7;
const long long int INF = 1011111111;
const long long int LLINF = 1000111000111000111LL;
const long double EPS = 1e-10;
const long double PI = 3.14159265358979323;
using namespace std;
long long int power(long long int base, long long int exponent) {
  long long int ans = 1;
  while (exponent != 0) {
    if (exponent & 1) ans = (1LL * ans * base);
    base = (1LL * base * base);
    exponent >>= 1;
  }
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, m, i, j, k, l;
    cin >> n >> k >> l;
    long long int d[n];
    for (int i = 0; i < n; i++) cin >> d[i];
    long long int p[2 * k];
    for (int i = 0; i <= k; i++) p[i] = i;
    for (int i = k + 1; i < 2 * k; i++) p[i] = 2 * k - i;
    vector<vector<bool> > possible(505, vector<bool>(505, false));
    bool ok = false;
    for (int i = 0; i < 2 * k; i++) {
      if (d[0] + p[i] > l) continue;
      possible[0][i] = true;
    }
    for (int i = 1; i < n; i++) {
      for (int j = 0; j < 2 * k; j++) {
        if (possible[i - 1][j]) {
          long long int cur = j - 1;
          long long int times = 0;
          while (times <= 2 * k) {
            times++;
            cur++;
            if (d[i - 1] + p[cur % (2 * k)] > l) break;
            if (d[i] + p[(cur + 1) % (2 * k)] > l) continue;
            possible[i][(cur + 1) % (2 * k)] = true;
          }
        }
      }
    }
    for (int i = 0; i < 2 * k; i++)
      if (possible[n - 1][i]) ok = true;
    if (ok)
      cout << "Yes" << '\n';
    else
      cout << "No" << '\n';
  }
  cerr << '\n'
       << "Time elapsed : " << clock() * 1000.0 / CLOCKS_PER_SEC << " ms"
       << '\n';
}
