#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 7;
int d[N];
int main(void) {
  ios::sync_with_stdio(false), cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    int n, k, l;
    cin >> n >> k >> l;
    int f = 0;
    for (int i = 1; i <= n; ++i) {
      cin >> d[i];
      d[i] = l - d[i];
      if (d[i] < 0) f = 1;
    }
    if (f) {
      cout << "No" << endl;
      continue;
    }
    vector<int> safe;
    safe.push_back(0);
    for (int i = 1; i <= n; ++i) {
      if (d[i] >= k) safe.push_back(i);
    }
    safe.push_back(n + 1);
    int ok = 1;
    for (int i = 0; i + 1 < safe.size() && ok; ++i) {
      int tide = k, down = 1;
      for (int j = safe[i] + 1; j <= safe[i + 1] - 1 && ok; ++j) {
        tide += down ? -1 : 1;
        if (down) tide = min(tide, d[j]);
        if (tide > d[j]) ok = 0;
        if (tide == 0) down = 0;
      }
    }
    cout << (ok ? "Yes" : "No") << endl;
  }
  return 0;
}
