#include <bits/stdc++.h>
using namespace std;
pair<int, int> intersect(int l1, int r1, int l2, int r2) {
  if ((r1 < l2) || (r2 < l1)) return {-1, -1};
  int l = max(l1, l2);
  int r = min(r1, r2);
  return {l, r};
}
int main() {
  int t;
  scanf("%d", &t);
  while (--t >= 0) {
    bool pos = true;
    int n, k, l;
    scanf("%d %d %d", &n, &k, &l);
    int d[n];
    for (int i = 0; i < n; ++i) scanf("%d", d + i);
    for (int i = 0; i < n; ++i) d[i] += k;
    pair<int, int> range = {0, 2 * k};
    for (int i = 0; i < n; ++i) {
      if (d[i] <= l) {
        range = {0, 2 * k};
      } else if (d[i] - k > l) {
        pos = false;
        break;
      } else {
        int rem = d[i] - l;
        rem = k - rem;
        pair<int, int> curr = {d[i] - l, d[i] - l + 2 * rem};
        pair<int, int> inter =
            intersect(range.first, range.second, curr.first, curr.second);
        if (inter.first == -1) {
          pos = false;
          break;
        }
        if (inter.first == range.first) {
          range = {inter.first + 1, curr.second};
        } else {
          range = {inter.first, curr.second};
        }
        if (range.first > range.second) {
          pos = false;
          break;
        }
      }
    }
    if (pos)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
