#include <bits/stdc++.h>
using namespace std;
long long int n, k, l, d[300005];
vector<int> isles;
bool possible(int idx) {
  int start = isles[idx], end = isles[idx + 1];
  if (end == start + 1) return true;
  vector<pair<int, bool> > events;
  for (int i = start + 1; i < end; i++) {
    if (d[i] + k - l <= k - d[i] + l) {
      events.push_back(make_pair(d[i] + k - l - (i - start), false));
      events.push_back(make_pair(k - d[i] + l - (i - start), true));
    }
  }
  sort(events.begin(), events.end());
  int num_active = 0;
  for (auto r : events) {
    if (r.second)
      num_active--;
    else
      num_active++;
    if (num_active == end - start - 1) return true;
  }
  return false;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    cin >> n >> k >> l;
    isles.clear();
    bool flag = true;
    isles.push_back(0);
    for (int i = 1; i <= n; i++) {
      cin >> d[i];
      if (d[i] > l) {
        flag = false;
      } else if (d[i] + k <= l) {
        isles.push_back(i);
      }
    }
    isles.push_back(n + 1);
    if (!flag) {
      cout << "No" << endl;
      continue;
    }
    for (int i = 0; i < isles.size() - 1; i++) {
      if (!possible(i)) {
        flag = false;
        break;
      }
    }
    if (!flag) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
}
