#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9 + 1;
void solve() {
  int n, k, l;
  cin >> n >> k >> l;
  vector<vector<pair<int, int>>> kek(n);
  bool f = true;
  for (int i = 0; i < n; i++) {
    int d;
    cin >> d;
    int mx = min(k, l - d);
    if (mx < 0) {
      f = false;
    }
    if (mx == 0) {
      kek[i].emplace_back(0, 0);
    } else if (mx == k)
      kek[i].emplace_back(0, 2 * k - 1);
    else {
      kek[i].emplace_back(2 * k - mx, 2 * k - 1);
      kek[i].emplace_back(0, mx);
    }
  }
  if (!f) {
    cout << "No\n";
    return;
  }
  vector<pair<int, int>> now;
  now.emplace_back(0, 2 * k - 1);
  for (int i = 0; i < n; i++) {
    vector<pair<int, int>> tmp;
    if ((int)now.size() == 1) {
      if (now.back().second == 2 * k - 1) {
        if (now.back().first == 2 * k - 1)
          tmp.emplace_back(0, 0);
        else {
          tmp.emplace_back(now.back().first + 1, 2 * k - 1);
          tmp.emplace_back(0, 0);
        }
      } else {
        tmp.emplace_back(now.back().first + 1, now.back().second + 1);
      }
    } else {
      if (now[0].first == 2 * k - 1) {
        tmp.emplace_back(0, now[1].second + 1);
      } else {
        tmp.emplace_back(now[0].first + 1, 2 * k - 1);
        tmp.emplace_back(0, now[1].second + 1);
      }
    }
    now = tmp;
    bool f = false;
    int L = INF;
    for (int j = 0; j < (int)now.size(); j++) {
      int l1 = now[j].first, r1 = now[j].second, l2 = kek[i][0].first,
          r2 = kek[i][0].second;
      if (max(l1, l2) > min(r1, r2)) continue;
      f = true;
      L = min(L, max(l1, l2));
    }
    if (f) {
      kek[i][0].first = L;
      now = kek[i];
      continue;
    }
    if ((int)kek[i].size() == 1) {
      cout << "No\n";
      return;
    }
    for (int j = 0; j < (int)now.size(); j++) {
      int l1 = now[j].first, r1 = now[j].second, l2 = kek[i][1].first,
          r2 = kek[i][1].second;
      if (max(l1, l2) > min(r1, r2)) continue;
      f = true;
      L = min(L, max(l1, l2));
    }
    if (f) {
      kek[i][1].first = L;
      now.clear();
      now.emplace_back(kek[i][1]);
      continue;
    }
    cout << "No\n";
    return;
  }
  cout << "Yes\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
