#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
  os << "[ ";
  for (auto v : V) os << v << " ";
  os << "]";
  return os;
}
template <class T>
ostream &operator<<(ostream &os, set<T> S) {
  os << "{ ";
  for (auto s : S) os << s << " ";
  return os << "}";
}
template <class L, class R>
ostream &operator<<(ostream &os, map<L, R> M) {
  os << "{ ";
  for (auto m : M) os << "(" << m.first << ":" << m.second << ") ";
  return os << "}";
}
template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
void solve() {
  long long n, k, l;
  cin >> n >> k >> l;
  long long a[n + 1];
  vector<long long> safe;
  safe.push_back(-1);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] + k <= l) {
      safe.push_back(i);
    }
  }
  a[n] = INT_MIN;
  safe.push_back(n);
  for (long long i = 1; i < safe.size(); i++) {
    bool decreasing = true;
    long long tide = k;
    for (long long j = safe[i - 1] + 1; j < safe[i]; j++) {
      if (a[j] + tide > l) {
        if (!decreasing) {
          cout << "No" << endl;
          return;
        } else {
          tide = l - a[j];
          if (tide < 0) {
            cout << "No" << endl;
            return;
          }
          if (tide == 0) {
            decreasing = false;
          }
        }
      }
      decreasing ? tide-- : tide++;
      if (tide == 0) {
        decreasing = false;
      }
    }
  }
  cout << "Yes" << endl;
}
int32_t main() {
  long long t;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
