#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 7;
int n, k, l, t, ans, d[maxn], ok[maxn];
int main() {
  for (scanf("%d", &t); t--;) {
    scanf("%d%d%d", &n, &k, &l);
    for (int i = 1; i <= n; ++i) scanf("%d", &d[i]);
    memset(ok, 0, sizeof(ok));
    for (int i = 1; i <= n; ++i)
      if (d[i] + k <= l) ok[i] = 1;
    int now = 1, orz = 0;
    while (now <= n) {
      while (ok[now] && now <= n) ++now;
      if (now == n + 1) break;
      int nowmax = 1, i = 0;
      while (!ok[now] && now <= n) {
        int nowh;
        if (nowmax + i < k) {
          nowh = k - nowmax - i;
          if (nowh + d[now] > l) {
            nowmax += nowh + d[now] - l;
            nowh = nowmax + i < k ? k - nowmax - i : nowmax + i - k;
            if (nowh + d[now] > l) {
              orz = 1;
              break;
            }
          }
        } else {
          nowh = nowmax + i - k;
          if (nowh + d[now] > l) {
            orz = 1;
            break;
          }
        }
        ++now;
        ++i;
      }
      if (orz) break;
    }
    if (!orz)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
