#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, k, l;
  cin >> n >> k >> l;
  vector<int> depths(n + 2, 0);
  vector<int> safes(1, 0);
  for (int i = 1; i <= n; i++) {
    cin >> depths[i];
    if (depths[i] + k <= l) safes.push_back(i);
  }
  safes.push_back(n + 1);
  vector<int> vars;
  for (int i = 0; i <= k; i++) vars.push_back(i);
  for (int i = k - 1; i > 0; i--) vars.push_back(i);
  for (int i = 0; i < safes.size() - 1; i++) {
    for (int t = 0; t < 2 * k; t++) {
      bool done = true;
      for (int m = 1; m <= safes[i + 1] - safes[i] - 1; m++) {
        if (depths[safes[i] + m] + vars[(m + t) % (2 * k)] > l) {
          done = false;
          break;
        }
      }
      if (done) break;
      if (t == 2 * k - 1) {
        cout << "No\n";
        return;
      }
    }
  }
  cout << "Yes\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  bool multi_run = 1;
  if (multi_run) {
    int t;
    cin >> t;
    while (t--) solve();
  } else {
    solve();
  }
}
