#include <bits/stdc++.h>
using namespace std;
const double PI = 3.1415926535897;
const int mod = 1e9 + 7;
const int M = 100005;
int INF = 1e9 + 5;
int solve() {
  int n, k, l;
  cin >> n >> k >> l;
  int d[n + 1];
  for (int i = 0; i < n; i++) cin >> d[i];
  for (int i = 0; i < n; i++)
    if (d[i] > l) return !(cout << "NO\n");
  int i = 0;
  vector<pair<int, int> > v;
  while (i < n) {
    int cnt = 0, j = i;
    while (i < n && d[i] + k > l) {
      cnt++;
      i++;
    }
    if (cnt)
      v.push_back({j, cnt});
    else
      i++;
  }
  for (int i = 0; i < int((v).size()); i++) {
    int j = v[i].first;
    int dec = d[j++] + k - l;
    while (dec < k && j < v[i].first + v[i].second) {
      dec += (d[j] + k - l > dec) ? d[j] + k - l - dec : 1;
      j++;
    }
    if (dec > k) return !(cout << "NO2\n");
    int t = 1;
    while (j < v[i].first + v[i].second) {
      if (l - d[j] + 1 <= t) return !(cout << "NO\n");
      t++;
      j++;
    }
  }
  cout << "YES\n";
  return 0;
}
int main() {
  cin.sync_with_stdio(false);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
