#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << "[ " << *it << " = " << a << " ] ";
  err(++it, args...);
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const pair<Tk, Tv>& p) {
  os << "{" << p.first << ',' << p.second << "}";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& p) {
  os << "[ ";
  for (T x : p) os << x << " ";
  os << "]" << '\n';
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& p) {
  os << "{ ";
  for (T x : p) os << x << " ";
  os << "}" << '\n';
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const map<Tk, Tv>& p) {
  os << "{ ";
  for (pair<Tk, Tv> x : p) os << x << " ";
  os << "}" << '\n';
  return os;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  cin >> t;
  while (t--) {
    long long int n, k, l;
    cin >> n >> k >> l;
    vector<long long int> depth;
    for (long long int i = 0; i < n; i++) {
      long long int a;
      cin >> a;
      depth.emplace_back(a);
    }
    bool pass = true;
    vector<long long int> safe;
    safe.emplace_back(-1);
    for (long long int i = 0; i < n; i++) {
      if (depth[i] + k <= l) {
        safe.emplace_back(i);
      }
    }
    safe.emplace_back(n);
    for (long long int i = 1; i < (long long int)safe.size(); i++) {
      long long int tide = k;
      bool down = true;
      for (long long int j = safe[i - 1] + 1; j < safe[i]; j++) {
        tide += down ? -1 : 1;
        if (depth[j] + tide > l && down) {
          tide = l - depth[j];
        }
        if (tide < 0 || (depth[j] + tide > l && !down)) {
          pass = false;
          break;
        }
        if (tide == 0) down = false;
      }
      if (!pass) break;
    }
    cout << (pass ? "Yes\n" : "No\n");
  }
  return 0;
}
