#include <bits/stdc++.h>
using namespace std;
long long int MOD = 1000000007;
long long int gcd(long long int a, long long int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return a / gcd(a, b) * b;
}
long long int power(long long int a, long long int n) {
  if (n == 0) return 1;
  long long int p = power(a, n / 2);
  p = (p * p) % MOD;
  if (n % 2)
    return (p * a) % MOD;
  else
    return p % MOD;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long int test = 1;
  cin >> test;
  while (test--) {
    long long int n, k, l;
    cin >> n >> k >> l;
    vector<long long int> depth(n);
    for (long long int i = 0; i < n; i++) {
      cin >> depth[i];
    }
    vector<long long int> p(2 * k);
    for (long long int i = 0; i <= k; i++) {
      p[i] = i;
    }
    for (long long int i = k + 1; i < 2 * k; i++) {
      p[i] = p[i - 1] - 1;
    }
    long long int mat[2 * k][n];
    for (long long int i = 0; i < 2 * k; i++) {
      for (long long int j = 0; j < n; j++) {
        mat[i][j] = depth[j] + p[i];
      }
    }
    bool dp[2 * k][n];
    memset(dp, 0, sizeof(dp));
    for (long long int i = 0; i < n; i++) {
      for (long long int j = 0; j < 2 * k; j++) {
        if (i == 0) {
          dp[j][i] = (mat[j][i] <= l);
        } else {
          dp[j][i] = (mat[j][i] <= l && (dp[(j - 1 + 2 * k) % (2 * k)][i] ||
                                         dp[(j - 1 + 2 * k) % (2 * k)][i - 1]));
        }
      }
    }
    bool flag = false;
    for (long long int i = 0; i < 2 * k; i++) {
      if (dp[i][n - 1]) {
        flag = true;
      }
    }
    if (flag) {
      cout << "YES";
    } else {
      cout << "NO";
    }
    cout << '\n';
  }
  return 0;
}
