#include <bits/stdc++.h>
using namespace std;
string impossible;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
clock_t startTime;
double getCurrentTime() {
  return (double)(clock() - startTime) / CLOCKS_PER_SEC;
}
const int N = 1e6 + 5;
long long MOD = 1e9 + 7;
long long n, m, k, i, j;
bool f0, f1, f2;
const int MAXN = 2e3;
long long d[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << fixed << setprecision(11);
  int tests = 1;
  cin >> tests;
  for (int te = 1; te <= tests; te++) {
    long long n, k, l;
    cin >> n >> k >> l;
    for (int i = 1; i <= n; i++) cin >> d[i];
    d[0] = -k;
    d[n + 1] = -k;
    set<tuple<int, int, bool>> s;
    function<bool(int, int, bool)> go = [&](int pos, int t, bool rise) {
      if (pos > n) return true;
      if (s.find({pos, t, rise}) != s.end()) return false;
      s.insert({pos, t, rise});
      t += rise ? 1 : -1;
      if (t == 0) rise = true;
      if (t == k) rise = false;
      if (d[pos] + t <= l && go(pos, t, rise)) return true;
      if (d[pos + 1] + t <= l && go(pos + 1, t, rise)) return true;
      return false;
    };
    if (go(0, 0, true))
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
