#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, t, k, l;
  cin >> t;
  while (t--) {
    cin >> n >> k >> l;
    std::vector<int> d(n + 2, -k);
    for (i = 1; i <= n; i++) {
      cin >> d[i];
    }
    set<tuple<int, int, bool>> mrk;
    function<bool(int, int, bool)> func = [&](int pos, int tide, bool down) {
      if (pos > n) {
        return true;
      }
      if (mrk.find({pos, tide, down}) != mrk.end()) {
        return false;
      }
      mrk.insert({pos, tide, down});
      tide += down ? -1 : 1;
      if (tide == 0) {
        down = false;
      }
      if (tide == k) {
        down = true;
      }
      if (d[pos] + tide <= l && func(pos, tide, down)) {
        return true;
      }
      if (d[pos + 1] + tide <= l && func(pos + 1, tide, down)) {
        return true;
      }
      return false;
    };
    if (func(0, 0, false)) {
      cout << "Yes"
           << "\n";
    } else {
      cout << "No"
           << "\n";
    }
  }
  return 0;
}
