#include <bits/stdc++.h>
using namespace std;
vector<string> vec_splitter(string s) {
  for (char& c : s) c = c == ',' ? ' ' : c;
  stringstream ss;
  ss << s;
  vector<string> res;
  for (string z; ss >> z; res.push_back(z))
    ;
  return res;
}
void debug_out(vector<string> args, int idx) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, Head H, Tail... T) {
  if (idx > 0) cerr << ", ";
  stringstream ss;
  ss << H;
  cerr << args[idx] << " = " << ss.str();
  debug_out(args, idx + 1, T...);
}
void localTest() {}
int main() {
  localTest();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n, k, l;
    cin >> n >> k >> l;
    vector<long long> D(n + 1), safe(1, 0);
    bool possible = true;
    for (long long i = 1; i <= n; ++i) {
      cin >> D[i];
      if (D[i] + k <= l) safe.push_back(i);
      if (D[i] > l) possible = false;
    }
    safe.push_back(n + 1);
    if (!possible)
      cout << "No\n";
    else {
      for (long long i = 1; i < safe.size() && possible; ++i) {
        bool down = true;
        long long hi = k, add = -1;
        for (long long j = safe[i - 1] + 1; j < safe[i]; ++j) {
          hi += add;
          if (down) hi -= max(0LL, D[j] + hi - l);
          if (hi < 0 || D[j] + hi > l) {
            possible = false;
            break;
          }
          if (!hi) {
            down = false;
            add = 1;
          }
        }
      }
      if (possible)
        cout << "Yes\n";
      else
        cout << "No\n";
    }
  }
  return 0;
}
