#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, i, l, k;
  cin >> t;
  while (t--) {
    cin >> n >> k >> l;
    int s = 0, f = 2 * k - 1, dep, flg = 1;
    for (i = 1; i <= n; i++) {
      cin >> dep;
      if (!flg) continue;
      if (l < dep) {
        cout << "NO" << endl;
        flg = 0;
      }
      if (!flg) continue;
      int s1 = k - 1 - (l - dep), f1 = k - 1 + (l - dep);
      if (s1 < 0) s1 = 0;
      if (f1 > 2 * k - 1) f1 = 2 * k - 1;
      if (s1 == 0 && f1 == 2 * k - 1) {
        s = 0;
        f = 2 * k - 1;
        continue;
      }
      if (s == 0 && f == 2 * k - 1) {
        s = s1;
        f = f1;
        continue;
      }
      s = max(s + 1, s1);
      f = f1;
      if (s > f) {
        cout << "NO" << endl;
        flg = 0;
      }
    }
    if (flg) cout << "YES" << endl;
  }
  return 0;
}
