#include <bits/stdc++.h>
using namespace std;
const long long sz = 3e5 + 10;
long long d[sz];
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, k, l;
    scanf("%lld", &n), scanf("%lld", &k), scanf("%lld", &l);
    for (long long i = 1; i <= n; ++i) scanf("%lld", &d[i]);
    long long tim = k + 1;
    bool ok = 1;
    for (long long i = 1; i <= n; i++) {
      if (d[i] + k <= l)
        tim = k;
      else {
        long long extra = 0;
        if (tim <= k)
          extra += tim;
        else
          extra += (k - (tim - k));
        long long depth = d[i] + extra;
        if (depth > l) {
          if (tim <= k || d[i] > l) {
            ok = 0;
            break;
          }
          long long h = l - d[i];
          tim = k + (k - h);
        }
      }
      tim++;
      tim %= (2 * k);
    }
    if (ok)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
