#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long int MOD = 1e9 + 7;
const int N = 1e6 + 6;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, k, l;
    cin >> n >> k >> l;
    vector<int> vec(n + 1), safe;
    safe.push_back(0);
    for (int i = 1; i <= n; i++) {
      cin >> vec[i];
      if (vec[i] + k <= l) safe.push_back(i);
    }
    safe.push_back(n + 1);
    int ok = 1;
    for (int i = 1; i < safe.size(); i++) {
      long long int dec = 1, extra = k;
      for (int j = safe[i - 1] + 1; j < safe[i]; j++) {
        if (dec)
          extra--;
        else
          extra++;
        if (vec[j] > l) ok = 0;
        if (dec && vec[j] + extra > l) {
          extra = l - vec[j];
        }
        if (extra < 0 || vec[j] + extra > l) ok = 0;
        if (extra == 0) dec = 0;
      }
    }
    if (ok)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
