#include <bits/stdc++.h>
using namespace std;
void start() {}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n, m, k;
    cin >> n >> m >> k;
    long long a[n];
    for (long long i = 0; i < n; i++) cin >> a[i];
    long long mx = m, mn = -m, d = 0;
    for (long long i = 0; i < n; i++) {
      if (a[i] > k) {
        d = 1;
        break;
      } else {
        mx = min(k - a[i], m);
        if (mx == m)
          mn = -m;
        else
          mn = max(mn + 1, -mx);
        if (mn > mx) {
          d = 1;
          break;
        }
      }
    }
    if (d)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
}
