#include <bits/stdc++.h>
using namespace std;
int arr[300001];
int n, k, l;
int check(int p, int t, int d) {
  if (d == p) return (1);
  int v = ((t % (2 * k)) <= k) ? (t % (2 * k)) : 2 * k - (t % (2 * k));
  if (arr[p] + v > l) return (0);
  return (check(p + 1, t + 1, d));
}
int check1(int p, int t, int d) {
  if (d == p) return (1);
  int v = ((t % (2 * k)) <= k) ? (t % (2 * k)) : 2 * k - (t % (2 * k));
  if (arr[p] + v > l) return (0);
  if (d == p - 1) return (1);
  if (arr[p + 1] == l) return (check(p + 1, 0, d));
  if (t + 1 == 2 * k) return (check(p + 1, 0, d));
  if (2 * k - (l - arr[p + 1]) > t + 1)
    return (check1(p + 1, 2 * k - (l - arr[p + 1]), d));
  return (check1(p + 1, t + 1, d));
}
int solve() {
  int i = 0;
  for (i = 0; i < n; ++i)
    if (arr[i] + k <= l) break;
  int ch = 0, c = -1;
  while (c != n) {
    ch = 0;
    if (c + 1 != i) {
      ch = check(c + 1, 0, i);
      if (l - arr[c + 1] >= 1)
        ch = max(ch, check1(c + 1, 2 * k - (l - arr[c + 1]), i));
    } else
      ch = 1;
    if (!ch) return (0);
    c = i;
    for (i = i + 1; i < n; ++i)
      if (arr[i] + k <= l) break;
  }
  return (1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int test = 1;
  cin >> test;
  for (; test > 0; --test) {
    cin >> n >> k >> l;
    int ch = 0;
    for (int i = 0; i < n; ++i) {
      cin >> arr[i];
      if (arr[i] > l) ch = 1;
    }
    if (ch) {
      cout << "No" << endl;
      continue;
    }
    ch = solve();
    if (ch)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
