#include <bits/stdc++.h>
using namespace std;
bool solve(vector<int> arr, vector<int> safe, int n, int k, int l) {
  int temp = k;
  bool dec = true;
  for (int i = 0; i < n; i++) {
    if (arr[i] > l) return false;
    if (safe[i]) continue;
    if (!i) temp = l - arr[0];
    if (i && safe[i - 1]) {
      temp = l - arr[i];
      dec = true;
    }
    if (temp + arr[i] > l && !dec) return false;
    if (temp + arr[i] > l && dec) temp = l - arr[i];
    if (temp == 0) dec = false;
    if (dec)
      temp--;
    else
      temp++;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n, k, l;
    cin >> n >> k >> l;
    vector<int> arr(n);
    for (int i = 0; i < (int)(n); ++i) cin >> arr[i];
    vector<int> safe(n, 0);
    for (int i = 0; i < (int)(n); ++i) {
      if (arr[i] + k <= l) safe[i] = 1;
    }
    if (solve(arr, safe, n, k, l))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
