#include <bits/stdc++.h>
int main() {
  int n_sets;
  unsigned long long n, k, l;
  std::cin >> n_sets;
  for (int j = 0; j < n_sets; j++) {
    std::cin >> n;
    std::cin >> k;
    std::cin >> l;
    std::vector<unsigned long long> d(n);
    unsigned long long current = k;
    bool lower = true;
    bool good = true;
    for (unsigned long long i = 0; i < n; i++) {
      std::cin >> d[i];
    }
    for (unsigned long long i = 0; i < n; i++) {
      if (d[i] > l) {
        std::cout << "No" << std::endl;
        good = false;
        break;
      }
      if (l - d[i] >= k) {
        current = k;
        lower = true;
      } else if (lower) {
        if (l - d[i] >= current) {
          current--;
        } else {
          current = l - d[i];
        }
        if (current == 0) {
          lower = false;
        }
      } else {
        if (l - d[i] <= current) {
          std::cout << "No" << std::endl;
          good = false;
          break;
        } else {
          current++;
        }
      }
    }
    if (good) {
      std::cout << "Yes" << std::endl;
    }
  }
  return 0;
}
