#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9 + 10;
const long long inf = 9e18 + 10;
const int MO = 1e9 + 7;
const double eps = 1e-3;
const int MAX_N = 210;
long long d[MAX_N], p[MAX_N];
vector<int> safe;
int main() {
  int t;
  cin >> t;
  while (t--) {
    safe.clear();
    long long n, k, h;
    scanf("%lld%lld%lld", &n, &k, &h);
    for (register int i = (1); i <= (n); ++i) scanf("%lld", d + i);
    for (register int i = (0); i <= (k); ++i) p[i] = k - i;
    for (register int i = (k + 1); i <= (2 * k - 1); ++i) p[i] = i - k;
    int mod = 2 * k;
    int ok = 1;
    safe.push_back(0);
    d[0] = d[n + 1] = -k;
    for (register int i = (1); i <= (n); ++i) {
      if (d[i] > h) ok = 0;
      if (d[i] + k <= h) safe.push_back((int)i);
    }
    safe.push_back(n + 1);
    if (!ok) {
      puts("NO");
      continue;
    }
    for (register int i = (0); i <= ((int)safe.size() - 2); ++i) {
      int L = safe[i], R = safe[i + 1];
      if (L + 1 == R) continue;
      long long time = 0;
      for (register int j = (L); j <= (R); ++j) {
        long long cha = h - d[j];
        time = max(time, k - cha - (j - L));
      }
      for (register int j = (L + 1); j <= (R); ++j) {
        if (d[j] + p[++time % mod] > h) {
          ok = 0;
          break;
        }
      }
      if (!ok) break;
    }
    if (ok)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
