#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long test;
  cin >> test;
  while (test--) {
    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>> tt;
    function<bool(long long, long long, bool)> go =
        [&](long long pos, long long tide, long long down) {
          if (pos > n) return true;
          if (tt.count({pos, tide, down}) > 0) return false;
          tt.insert({pos, tide, down});
          tide += down ? -1 : +1;
          if (tide == k) down = true;
          if (tide == 0) down = false;
          if (d[pos] + tide <= l && go(pos, tide, down)) {
            return true;
          }
          if (d[pos + 1] + tide <= l && go(pos + 1, tide, down)) {
            return true;
          }
          return false;
        };
    if (go(0, 0, false)) {
      cout << "YES"
           << "\n";
    } else {
      cout << "NO"
           << "\n";
    }
  }
  return 0;
}
