#include <bits/stdc++.h>
using namespace std;
const long long int INF = (long long int)2e18 + 77;
void solve() {
  int n, k, l, pos, time;
  cin >> n >> k >> l;
  int a[n + 2][2 * k], d[n];
  for (pos = 0; pos < n; pos++) cin >> d[pos], a[pos + 1][0] = d[pos];
  for (time = 0; time < 2 * k; time++) a[0][time] = a[n + 1][time] = 0;
  for (time = 1; time < 2 * k; time++) {
    int d = -1;
    if (time <= k) d = 1;
    for (pos = 1; pos <= n; pos++)
      a[pos][time] = a[pos][((time - 1) + 2 * k) % (2 * k)] + d;
  }
  int dp[n + 2][2 * k];
  for (time = 0; time < 2 * k; time++) dp[0][time] = 1;
  for (pos = 1; pos <= n + 1; pos++) {
    for (time = 0; time < 2 * k; time++) {
      if (a[pos - 1][(time - 1 + 2 * k) % (2 * k)] <= l && a[pos][time] <= l &&
          dp[pos - 1][(time - 1 + 2 * k) % (2 * k)])
        dp[pos][time] = 1;
      else
        dp[pos][time] = 0;
    }
    for (time = 0; time < 2 * k; time++) {
      if (dp[pos][time] == 0 && dp[pos][((time - 1) + 2 * k) % (2 * k)] == 1 &&
          a[pos][time] <= l)
        dp[pos][time] = 1;
    }
  }
  int f = 0;
  for (time = 0; time < 2 * k; time++)
    if (dp[n + 1][time]) {
      f = 1;
      break;
    }
  if (f)
    cout << "Yes\n";
  else
    cout << "No\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int TC;
  cin >> TC;
  while (TC--) solve();
  return 0;
}
