#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long t;
  cin >> t;
  for (long long xy = 1; xy <= t; xy++) {
    long long n, k, l;
    cin >> n >> k >> l;
    long long d[n];
    long long flag = 0;
    for (long long i = 0; i < n; i++) {
      cin >> d[i];
      if ((d[i] > l)) flag = 1;
    }
    if (flag == 1) {
      cout << "NO\n";
    } else {
      long long fff = 0;
      long long val1 = min(k, l - d[0]);
      long long val2 = min(k, (l - d[0]));
      for (long long i = 1; i < n; i++) {
        long long start = 0;
        if (d[i - 1] + k <= l) {
          val1 = min(k, (l - d[i]));
          val2 = min(k, (l - d[i]));
        } else {
          if (val2 <= 0) start = abs(val2) + 1;
          long long dd = l - d[i];
          val2 = val2 - 1;
          if (dd < val2) val2 = dd;
          val1 = val1 + 1;
          if (dd < val1) val1 = dd;
          if (((val1 - start) < 0) && (val2 <= 0)) {
            fff = 1;
            break;
          }
        }
      }
      if (fff == 1)
        cout << "NO\n";
      else if (fff == 0)
        cout << "YES\n";
    }
  }
}
