#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n, k, l;
int d[N];
vector<int> p;
int cache[N][2 * N];
int dp(int i, int curr) {
  if (i > n) return 1;
  if (d[i] + p[curr] > l) return 0;
  int &ans = cache[i][curr];
  if (ans != -1) return ans;
  ans = 0;
  for (int j = 0; j < 2 * k; j++) {
    int willBe = d[i] + p[(j + curr) % (2 * k)];
    if (willBe > l) break;
    ans |= dp(i + 1, (j + curr + 1) % (2 * k));
  }
  return ans;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    cin >> n >> k >> l;
    for (int i = 1; i <= n; i++) cin >> d[i];
    p.clear();
    for (int i = 0; i <= k; i++) p.push_back(i);
    for (int i = k - 1; i > 0; i--) p.push_back(i);
    for (int i = 0; i <= n; i++)
      for (int j = 0; j <= 2 * k; j++) cache[i][j] = -1;
    int ans = 0;
    for (int i = 0; i < 2 * k; i++) {
      if (dp(1, i)) {
        ans = 1;
        break;
      }
    }
    if (ans)
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
  }
  return 0;
}
