#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n, k, l;
    cin >> n >> k >> l;
    vector<long long> d(n);
    for (long long i = 0; i < n; ++i) cin >> d[i];
    vector<long long> k2(k * 2);
    for (long long i = 1; i <= k; ++i) k2[i] = k2[i - 1] + 1;
    for (long long i = k + 1; i < k * 2; ++i) k2[i] = k2[i - 1] - 1;
    vector<vector<long long>> a(n + 1, vector<long long>(k * 2));
    for (long long i = 0; i < k * 2; ++i) a[0][i] = 1;
    for (long long i = 1; i <= n; ++i) {
      for (long long j = 0; j < 2 * k; ++j)
        if (d[i - 1] + k2[j] <= l)
          a[i][j] = a[i - 1][(j - 1 + k * 2) % (k * 2)];
      for (long long j = 0; j < k * 2; ++j)
        if (d[i - 1] + k2[j] <= l)
          a[i][j] = a[i][j] | a[i][(j - 1 + k * 2) % (k * 2)];
      for (long long j = 0; j < k * 2; ++j)
        if (d[i - 1] + k2[j] <= l)
          a[i][j] = a[i][j] | a[i][(j - 1 + k * 2) % (k * 2)];
    }
    bool f = 0;
    for (long long i = 0; i < k * 2; ++i) f = f || a[n][i];
    if (f)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
