#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    long long n, k, l;
    cin >> n >> k >> l;
    std::vector<long long> dep(n + 1), safe(1, 0);
    for (int i = 0; i < n; ++i) {
      cin >> dep[i + 1];
      if (dep[i + 1] + k <= l) safe.emplace_back(i + 1);
    }
    safe.emplace_back(n + 1);
    bool reachable = true;
    for (int i = 1; i < safe.size(); ++i) {
      long long t = k, d = 1, z = 0;
      for (int j = safe[i - 1] + 1; j < safe[i]; ++j) {
        t += d ? -1 : +1;
        if (d) t -= max(z, dep[j] + t - l);
        if (t < 0 || dep[j] + t > l) {
          reachable = false;
          break;
        }
        if (t == 0) d = false;
      }
    }
    if (reachable)
      cout << "Yes" << '\n';
    else
      cout << "No" << '\n';
  }
  return 0;
}
