#include <bits/stdc++.h>
using namespace std;
bool solve(int n, int k, int l, vector<int> &d) {
  int curT = INT_MIN;
  for (int i = 0; i < n; ++i) {
    if (d[i] > l) return false;
    if (d[i] + k <= l) {
      curT = INT_MIN;
    } else {
      int st = -(l - d[i]);
      int ed = l - d[i];
      if (curT < st)
        curT = st;
      else
        ++curT;
      if (curT > ed) return false;
    }
  }
  return true;
}
int main() {
  cin.sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int n, k, l;
    cin >> n >> k >> l;
    vector<int> d;
    d.resize(n);
    for (int i = 0; i < n; ++i) cin >> d[i];
    if (solve(n, k, l, d))
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
