#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5;
int d[maxn];
int rem[maxn];
long long dp[maxn + 1];
int main() {
  int t;
  cin >> t;
  int n, k, l;
  int _i, _j, id;
  bool pass0, check;
  while (t--) {
    cin >> n >> k >> l;
    check = true;
    vector<int> pos;
    pos.push_back(-1);
    for (int i = 0; i < n; i++) {
      cin >> d[i];
      if (d[i] > l) check = false;
      rem[i] = l - d[i];
      if (rem[i] >= k) pos.push_back(i);
    }
    pos.push_back(n);
    for (int i = 0; i < pos.size() - 1 && check; i++) {
      _i = pos[i] + 1;
      _j = pos[i + 1] - 1;
      pass0 = false;
      id = 1;
      dp[0] = k + 1;
      for (int j = _i; j <= _j; j++) {
        if (pass0) {
          if (dp[id - 1] + 1 > rem[j]) {
            check = false;
            break;
          }
          dp[id] = dp[id - 1] + 1;
        } else {
          dp[id] = min(dp[id - 1] - 1, 1LL * rem[j]);
          if (dp[id] == 0) pass0 = true;
        }
        id++;
      }
    }
    if (check)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
