#include <bits/stdc++.h>
using namespace std;
const int N = 300005;
int t, n, k, l, flag;
int low[N], high[N], d;
int P(int x) {
  x = x % (2 * k);
  if (x > k) return 2 * k - x;
  return x;
}
int main() {
  scanf("%d", &t);
  while (t--) {
    flag = 0;
    scanf("%d%d%d", &n, &k, &l);
    for (int i = 1; i <= n; i++) {
      scanf("%d", &d);
      if (d > l) flag = 1;
      if (flag) continue;
      if (l - d >= k) {
        high[i] = low[i] = k;
        continue;
      } else {
        high[i] = l - d;
        low[i] = 2 * k - l + d;
      }
      if (i > 1) {
        if (low[i] == k) continue;
        if (low[i - 1] >= k)
          low[i] = max(low[i], low[i - 1] + 1);
        else
          low[i] = low[i - 1] + 1;
        low[i] %= 2 * k;
        if (low[i] > k) continue;
        if (high[i] < low[i]) flag = 1;
      }
    }
    if (flag)
      puts("No");
    else
      puts("Yes");
  }
  return 0;
}
