#include <bits/stdc++.h>
using namespace std;
struct _ {
  ios_base::Init i;
  _() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); }
} _;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
class MainClass {
 public:
  void solve() {
    int n, k, l;
    cin >> n >> k >> l;
    vector<int> d(n + 1, 0);
    for (int i = 1; i <= n; i++) cin >> d[i];
    vector<int> delta(2 * k, 0);
    for (int i = 0; i <= k; i++) delta[i] = i;
    for (int i = k + 1; i <= 2 * k - 1; i++) delta[i] = delta[i - 1] - 1;
    debug() << " ["
            << "delta"
               ": "
            << (delta) << "] ";
    vector<vector<bool>> dp(n + 1, vector<bool>(2 * k, false));
    for (int t = 0; t <= 2 * k - 1; t++) dp[0][t] = true;
    for (int i = 1; i <= n; i++) {
      for (int t = 0; t <= 2 * k - 1; t++) {
        if (d[i] + delta[t] > l) continue;
        dp[i][t] = dp[i - 1][(t - 1 + 2 * k) % (2 * k)] or
                   dp[i][(t - 1 + 2 * k) % (2 * k)];
      }
    }
    debug() << " ["
            << "dp"
               ": "
            << (dp) << "] ";
    for (int t = 0; t <= 2 * k - 1; t++) {
      if (dp[n][t]) {
        cout << "Yes";
        return;
      }
    }
    cout << "No";
    return;
  }
};
int main() {
  int test = 1;
  cin >> test;
  for (int tst = 1; tst <= test; ++tst) {
    MainClass Ausmosian;
    Ausmosian.solve();
    cout << "\n";
  }
  return 0;
}
