#include <bits/stdc++.h>
using namespace std;
int n, k, l, T;
inline int Max(const int p, const int q) { return p > q ? p : q; }
int main() {
  scanf("%d", &T);
  register int x;
  while (T--) {
    scanf("%d%d%d", &n, &k, &l);
    register int fl = 1, lst = 0;
    for (register int i = 1; i <= n; ++i) {
      scanf("%d", &x);
      if (x > l) fl = 0;
      if (x + k <= l)
        lst = 0;
      else if (lst < k)
        lst = Max(lst + 1, k - (l - x));
      else
        (k + (l - x) < lst + 1) ? fl = 0 : ++lst;
    }
    fl ? puts("Yes") : puts("No");
  }
  return 0;
}
