#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
int d[N];
void solve() {
  int n, k, l;
  cin >> n >> k >> l;
  for (int i = 0; i < n; ++i) cin >> d[i];
  int tim = 0;
  for (int i = 0; i < n; ++i) {
    if (d[i] > l) {
      printf("No\n");
      return;
    }
    if (d[i] + k <= l) tim = 0;
    int time_depth = k - tim;
    time_depth = abs(time_depth);
    if (time_depth + d[i] <= l) {
      ++tim;
      continue;
    } else {
      if (tim >= k) {
        printf("No\n");
        return;
      } else {
        int req_time = l - d[i];
        req_time = k - req_time;
        tim = req_time + 1;
      }
    }
  }
  printf("Yes\n");
  return;
}
int main() {
  (ios_base::sync_with_stdio(false), cin.tie(NULL));
  ;
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
