#include <bits/stdc++.h>
const double eps = 1e-8;
const int oo = 0x3f3f3f3f;
using namespace std;
int n, k, l;
int r[555555];
vector<int> wait;
bool read() {
  if (scanf("%d%d%d", &n, &k, &l) == EOF) return false;
  r[0] = -k;
  for (int i = 1; i < n + 1; i++) scanf("%d", &r[i]);
  r[n + 1] = -k;
  n += 2;
  return true;
}
bool solve(int a, int b) {
  int t = r[a + 1];
  int pos = a + 1;
  bool dir = false;
  while (pos != b) {
    if (0) printf("pos %d, t %d, dir %d\n", pos, t, dir);
    if (t == 0) dir = true;
    if (dir == false) {
      int next_t = t - 1;
      if (r[pos + 1] < next_t) next_t = r[pos + 1];
      t = next_t;
      pos++;
    } else {
      int next_t = t + 1;
      if (r[pos + 1] < next_t) return false;
      t = next_t;
      pos++;
    }
  }
  return true;
}
void process() {
  wait.clear();
  for (int i = 0; i < n; i++) {
    if (r[i] > l) {
      printf("No\n");
      return;
    }
    r[i] = l - r[i];
    if (0) printf("%d ", r[i]);
  }
  if (0) printf("\n");
  for (int i = 0; i < n; i++) {
    if (r[i] >= k) {
      if (0) printf("%d\n", i);
      wait.push_back(i);
    }
  }
  for (int i = 0; i < wait.size() - 1; i++) {
    if (0) printf("Solving %d %d\n", wait[i], wait[i + 1]);
    if (!solve(wait[i], wait[i + 1])) {
      printf("No\n");
      return;
    }
  }
  printf("Yes\n");
}
int main() {
  int t = -1;
  scanf("%d", &t);
  while (t-- && read()) {
    process();
  }
  return 0;
}
