#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int N = 3e5 + 5;
long long t, n, k, L, d[N], safe[N], l[N], r[N];
long long get_depth(long long idx, long long time) {
  time %= (2 * k);
  if (time > k) time = k - abs(k - time);
  return d[idx] + time;
}
bool solve(int idx, long long time) {
  if (safe[idx] == 2e9) return 0;
  if (idx == n) return 1;
  bool ret = 0;
  if (safe[idx] == -1)
    return solve(idx + 1, safe[idx + 1]);
  else {
    if (safe[idx + 1] == -1)
      return solve(idx + 1, safe[idx + 1]);
    else {
      if (time > r[idx]) {
        int nxt = max(time, r[idx + 1]) + 1;
        if (nxt < 2 * k)
          return solve(idx + 1, nxt);
        else if (0 <= l[idx] && 0 < l[idx + 1])
          return solve(idx + 1, 0);
      } else if (time < l[idx]) {
        if (time + 1 < l[idx + 1]) return solve(idx + 1, time + 1);
      }
    }
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n >> k >> L;
    for (int i = 0; i <= n; i++) safe[i] = 0;
    bool ok = 1;
    for (int i = 1; i <= n; i++) {
      cin >> d[i];
      if (d[i] + k <= L)
        safe[i] = -1;
      else {
        int x = abs(L - d[i]);
        safe[i] = (2 * k - x) % (2 * k);
        l[i] = x + 1, r[i] = 2 * k - x - 1;
        if (d[i] > L) safe[i] = 2e9;
      }
    }
    safe[0] = -1;
    if (solve(0, 0))
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
