#include <bits/stdc++.h>
using namespace std;
const int N = 300100;
long long int d[N];
long long int n, k, l, t;
void solve() {
  cin >> n >> k >> l;
  memset(d, 0, sizeof(d));
  for (int i = 1; i <= n; i++) cin >> d[i];
  vector<pair<long long int, long long int> > last, sad, novi;
  long long int diff = l - d[1], x = 0;
  if (diff < 0) {
    cout << "No \n";
    return;
  }
  if (diff > k)
    x = k;
  else
    x = diff;
  if (x == k)
    last.push_back(make_pair(0, 2 * k - 1));
  else {
    last.push_back(make_pair(0, x));
    if (x >= 1) last.push_back(make_pair(2 * k - x, 2 * k - 1));
  }
  for (int q = 2; q <= n; q++) {
    long long int diff = l - d[q], x = 0;
    if (diff < 0) {
      cout << "No \n";
      return;
    }
    if (diff > k)
      x = k;
    else
      x = diff;
    if (x == k)
      sad.push_back(make_pair(0, 2 * k - 1));
    else {
      sad.push_back(make_pair(0, x));
      if (x >= 1) sad.push_back(make_pair(2 * k - x, 2 * k - 1));
    }
    for (int i = 0; i < last.size(); i++) {
      for (int j = 0; j < sad.size(); j++) {
        long long int x1, x2, y1, y2;
        x2 = sad[j].first, y2 = sad[j].second;
        if (last[i].second == 2 * k - 1) {
          x1 = 0, y1 = 0;
          if (y1 < x2 || y2 < x1) {
          } else {
            if (y2 >= y1)
              novi.push_back(make_pair(max(x1, x2), max(y1, y2)));
            else
              novi.push_back(make_pair(max(x1, x2), min(y1, y2)));
          }
        }
        x1 = last[i].first + 1;
        y1 = min(last[i].second + 1, 2 * k - 1);
        if (y1 < x2 || y2 < x1) {
        } else {
          if (y2 >= y1)
            novi.push_back(make_pair(max(x1, x2), max(y1, y2)));
          else
            novi.push_back(make_pair(max(x1, x2), min(y1, y2)));
        }
      }
    }
    sort(novi.begin(), novi.end());
    last.clear();
    if (!novi.empty()) {
      long long int otv = novi[0].first, zat = novi[0].second;
      for (int i = 1; i < novi.size(); i++) {
        if (novi[i].first <= zat + 1) {
          zat = novi[i].second;
        } else {
          last.push_back(make_pair(otv, zat));
          otv = novi[i].first, zat = novi[i].second;
        }
      }
      last.push_back(make_pair(otv, zat));
    }
    novi.clear();
    sad.clear();
    if (last.empty()) {
      cout << "No \n";
      return;
    }
  }
  cout << "Yes \n";
  return;
}
int main() {
  cin >> t;
  while (t--) solve();
  return 0;
}
