#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, k, l;
    cin >> n >> k >> l;
    vector<long long int> a(n + 1);
    vector<long long int> safe;
    safe.push_back(0);
    for (long long int i = 1; i <= n; i++) {
      cin >> a[i];
      if ((a[i] + k) <= l) {
        safe.push_back(i);
      }
    }
    safe.push_back(n + 1);
    long long int f = 1;
    for (long long int i = 1; i < safe.size(); i++) {
      long long int td = k, d = 1;
      for (long long int j = safe[i - 1] + 1; j < safe[i] && f; j++) {
        if (d) {
          td -= 1;
        } else {
          td += 1;
        }
        if (d) {
          td -= max(0 * 1ll, a[j] + td - l);
        }
        if (td < 0 || a[j] + td > l) {
          f = 0;
          break;
        }
        if (td == 0) {
          d = 0;
        }
      }
    }
    if (f) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
