#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 0;
  cin >> t;
  while (t--) {
    int n = 0, k = 0, l = 0;
    cin >> n >> k >> l;
    bool ans = true;
    vector<int> d(n);
    for (int i = 0; i < n; i++) cin >> d[i];
    int left = 0, right = 2 * k, base = 0;
    for (int i = 0; i < n && ans; i++) {
      int cd = d[i];
      if (cd + k <= l) {
        base = i;
        left = 0;
        right = 2 * k;
      } else {
        if (cd > l)
          ans = false;
        else {
          left = max(left, k + cd - l - (i - base));
          right = min(right, k - cd + l - (i - base));
          ans = (left <= right);
        }
      }
    }
    cout << (ans ? "Yes\n" : "No\n");
  }
  return 0;
}
