#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, k, l, d[3 * 100000];
  cin >> n >> k >> l;
  for (int ii = 1; ii < n + 1; ii++) cin >> d[ii];
  vector<pair<int, int> > a;
  a.push_back(make_pair(-k, k));
  for (int ii = 1; ii < n + 1; ii++) {
    int s, e, tmp;
    if (d[ii] > l) {
      cout << "NO";
      return;
    }
    tmp = l - d[ii];
    s = -min(k, tmp);
    e = min(k, tmp);
    a.push_back(make_pair(s, e));
  }
  for (int ii = 1; ii < n + 1; ii++) {
    if (a[ii - 1].second != k) {
      a[ii].first = max(a[ii - 1].first + 1, a[ii].first);
    }
    if (a[ii].first > a[ii].second) {
      cout << "NO";
      return;
    }
  }
  cout << "YES";
  return;
}
int main() {
  int tttt;
  scanf("%i", &tttt);
  for (int TTTT = 0; TTTT < tttt; TTTT++) {
    solve();
    cout << endl;
  }
}
