#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e9 + 7;
void show() {
  int n, k, l;
  cin >> n >> k >> l;
  int d[n];
  for (int i = 0; i < n; i++) cin >> d[i];
  int time = 0;
  for (int i = 0; i < n; i++) {
    if (d[i] > l) {
      cout << "No\n";
      return;
    }
    if (d[i] + k <= l) {
      time = 0;
    }
    int tide = abs(k - time);
    if (tide + d[i] <= l) {
      time++;
      continue;
    } else {
      if (time >= k) {
        cout << "No\n";
        return;
      } else {
        int reqtide = l - d[i];
        int reqtime = k - reqtide;
        time = reqtime + 1;
      }
    }
  }
  cout << "Yes\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) show();
  return 0;
}
