#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
int n, k, l;
pair<int, int> a[500500];
int dst(int x, int y) {
  if (y >= x) return y - x;
  int sz = 2 * k - 1;
  return sz - x + 1 + y;
}
void solve() {
  cin >> n >> k >> l;
  bool gg = false;
  a[0] = {-1, -1};
  for (int i = 1; i <= n; ++i) {
    int d;
    cin >> d;
    if (d > l) gg = true;
    int val = l - d;
    if (val >= k) {
      a[i] = {-1, -1};
      continue;
    }
    int left = val + 1, right = 2 * k - 1 - val;
    a[i] = {left, right};
  }
  if (gg) {
    cout << "No\n";
    return;
  }
  int t = 0, m = 2 * k;
  for (int i = 0; i < n; ++i) {
    if (a[i].first <= t && t <= a[i].second) {
      cout << "No"
           << "\n";
      return;
    }
    if (a[i].first == -1) {
      t = (a[i + 1].second + 1) % m;
      continue;
    }
    if (dst(t, a[i + 1].second) < dst(t, a[i].first)) {
      t = (a[i + 1].second + 1) % m;
      continue;
    }
    t = (t + 1) % m;
  }
  if (a[n].first <= t && t <= a[n].second) {
    cout << "No\n";
    return;
  }
  cout << "Yes\n";
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  for (int i = 1; i <= t; ++i) {
    solve();
  }
  return 0;
}
