#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, k, l;
    cin >> n >> k >> l;
    vector<long long int> depth(n, 0), safe;
    for (long long int i = 0; i < n; i++) {
      cin >> depth[i];
      if (depth[i] + k <= l) safe.push_back(i);
    }
    bool possible = true;
    long long int sz = safe.size();
    long long int temp = k;
    for (int i = 0; i < sz + 1; i++) {
      long long int start, end;
      if (i == 0) {
        start = -1;
        if (sz == 0)
          end = n;
        else
          end = safe[0];
      } else if (i == sz) {
        start = safe[i - 1];
        end = n;
      } else {
        start = safe[i - 1];
        end = safe[i];
      }
      temp = k - 1;
      bool decrease = true;
      start++;
      while (start != end) {
        if (decrease) {
          if (temp + depth[start] > l) {
            temp = l - depth[start];
          }
          if (temp < 0) {
            possible = false;
            break;
          }
          if (temp == 0) {
            decrease = false;
            temp = 1;
          }
          if (decrease) temp--;
        } else {
          if (temp + depth[start] > l) {
            possible = false;
            break;
          }
          temp++;
          if (temp == k + 1) {
            decrease = true;
            temp = k - 1;
          }
        }
        start++;
      }
      if (!possible) break;
    }
    if (possible)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
