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