#include <bits/stdc++.h>
using namespace std;
void solve(std::istream &in, std::ostream &out);
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout.tie(nullptr);
  solve(std::cin, std::cout);
  return 0;
}
void solve_test(std::istream &in, std::ostream &out) {
  int n, k, l;
  in >> n >> k >> l;
  vector<int> d(n + 2, 0);
  for (int i = 1; i <= n; ++i) {
    in >> d[i];
    d[i] -= l;
  }
  for (int i = 1; i <= n; ++i) {
    d[i] *= -1;
    if (d[i] >= k) d[i] = k;
    if (d[i] < 0) {
      out << "No\n";
      return;
    }
  }
  int time = 0;
  int val = -d[1];
  for (int i = 2; i <= n; ++i) {
    if (val < -d[i] || d[i - 1] == k) {
      val = -d[i];
      continue;
    }
    if (val == k) val *= -1;
    val += 1;
    if (val < -d[i] || val > d[i]) {
      out << "No\n";
      return;
    }
  }
  out << "Yes\n";
}
void solve(std::istream &in, std::ostream &out) {
  int tests;
  in >> tests;
  while (tests--) {
    solve_test(in, out);
  }
}
