#include <bits/stdc++.h>
const int N = 1e9 - 100;
const int mod = 999999929;
int s[200];
void solve() {
  int n, k, l;
  scanf("%d%d%d", &n, &k, &l);
  for (int i = 0; i < n; i++) {
    scanf("%d", &s[i]);
    s[i] = -s[i];
    s[i] += l;
    s[i] -= k;
  }
  int st = 0, flag = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] >= 0) {
      st = 0;
      flag = 0;
      continue;
    }
    if (st + s[i] >= 0) {
      if (st == k) {
        flag = !flag;
      }
      if (flag)
        st--;
      else
        st++;
    } else if (st + s[i] < 0) {
      if (flag) {
        puts("NO");
        return;
      } else {
        st = -s[i];
        if (st > k) {
          puts("NO");
          return;
        } else if (st == k) {
          flag = 1, st--;
        } else
          st++;
      }
    }
  }
  puts("YES");
}
using namespace std;
signed main() {
  int t = 1;
  scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}
