#include <bits/stdc++.h>
using namespace std;
long long int MPOW(long long int x, long long int y) {
  if (y == 0) return (long long int)1;
  long long int ret = MPOW(x, y / 2);
  ret *= ret;
  ret %= 1000000007;
  if (y & 1) ret *= x;
  return ret % 1000000007;
}
long long int inv(long long int x) { return MPOW(x, 1000000007 - 2); }
int main() {
  cout.setf(ios::fixed);
  cout.setf(ios::showpoint);
  cout.precision(10);
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t-- > 0) {
    int n, k, l;
    cin >> n >> k >> l;
    vector<int> d(n);
    for (int i = 0; i < n; i++) cin >> d[i];
    int mi = -k, mx = k;
    bool ans = 1;
    for (int i = 0; i < n; i++) {
      if (d[i] > l) {
        ans = 0;
        break;
      }
      mx = min(l - d[i], k);
      if (mx == k) {
        mi = -k;
      } else {
        mi = max(mi + 1, -mx);
      }
      if (mi > mx) {
        ans = 0;
        break;
      }
    }
    if (ans)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
