#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long mod = 1e9 + 7;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, k, l;
    cin >> n >> k >> l;
    vector<long long> d(n + 1), rest;
    for (long long i = 0; i < (n); i++) {
      cin >> d[i];
      if (d[i] + k <= l) rest.push_back(i);
    }
    d[n] = -mod;
    rest.push_back(n);
    long long pos = -1;
    bool ans = true;
    while (pos < n) {
      long long next;
      auto it1 = upper_bound(rest.begin(), rest.end(), pos) - rest.begin();
      if (it1 == -1) {
        next = rest[it1 + 1];
      } else {
        long long it = rest[it1];
        if (it == pos) {
          next = rest[it1 + 1];
        } else {
          next = it;
        }
      }
      bool ok = false;
      for (long long s = 0; s < (2 * k); s++) {
        bool good = true;
        long long cur = pos + 1;
        for (long long times = s; times < s + next - cur; times++) {
          long long de;
          if ((times % (2 * k)) >= k) {
            de = 2 * k - (times % (2 * k));
          } else {
            de = times % (2 * k);
          }
          if (de + d[times + cur - s] > l) {
            good = false;
            break;
          }
        }
        if (good) {
          ok = true;
          pos = next;
          break;
        }
      }
      if (!ok) {
        ans = false;
        break;
      }
    }
    if (ans) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
