#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long long INF = 1e18;
const long double PI = acos((long double)-1);
void solve() {
  int n, k, l;
  cin >> n >> k >> l;
  int extraTime = k;
  bool canSwim = true;
  for (int i = (0); i < (n); ++i) {
    int depth;
    cin >> depth;
    int diff = l - depth;
    if (diff < 0) {
      canSwim = false;
    } else {
      if (diff >= k) {
        extraTime = k;
      } else {
        extraTime = min(extraTime - 1, diff);
      }
      if (-extraTime > diff) {
        canSwim = false;
      }
    }
  }
  if (canSwim) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
