#include <bits/stdc++.h>
using namespace std;
long long t;
long long n, k, l;
long long a[2222222];
pair<long long, long long> rg[2222222];
pair<long long, long long> getrange(long long x) {
  long long up = max(0LL, x + k - l);
  long long down = min(2 * k - 1, k + l - x);
  if (up >= k) {
    if (down < k) {
      return make_pair(0, -100);
    } else
      return make_pair(k, down);
  } else
    return make_pair(up, down);
}
long long solve() {
  cin >> n >> k >> l;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    rg[i] = getrange(a[i]);
  }
  for (int i = 1; i < n; i++) {
    pair<long long, long long> pre = rg[i - 1];
    if (rg[i].first == 0 && pre.second == 2 * k - 1)
      rg[i].first = 0;
    else
      rg[i].first = max(rg[i].first, pre.first + 1);
    if (pre.second != 2 * k - 1)
      rg[i].second = min(rg[i].second, pre.second + 1);
    if (rg[i].second < rg[i].first) {
      cout << "No\n";
      return 0;
    } else if (a[i] + k <= l) {
      rg[i].first = 0;
      rg[i].second = 2 * k - 1;
    }
  }
  if (rg[n - 1].second >= rg[n - 1].first)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
