#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, k, pm;
  cin >> n;
  cin >> k;
  cin >> pm;
  vector<long long> arr(n + 1);
  vector<long long> kd;
  kd.push_back(0);
  for (long long int i = 1; i <= n; i++) {
    cin >> arr[i];
    if (arr[i] + k <= pm) {
      kd.push_back(i);
    }
  }
  kd.push_back(n + 1);
  bool flag = true;
  for (long long int i = 1; i < (long long int)kd.size(); ++i) {
    long long int sks = k;
    bool pk = true;
    for (long long int j = kd[i - 1] + 1; j < kd[i]; ++j) {
      sks += pk ? -1 : 1;
      if (pk) {
        sks -= max(0ll, arr[j] + sks - pm);
      }
      if (sks < 0 || arr[j] + sks > pm) {
        flag = false;
        break;
      }
      if (sks == 0) {
        pk = false;
      }
    }
    if (!flag) {
      break;
    }
  }
  if (flag) {
    cout << "YES";
    cout << '\n';
  } else {
    cout << "NO";
    cout << '\n';
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
