#include <bits/stdc++.h>
using namespace std;
const int maxm = 2e3 + 23;
const int maxn = 3e5 + 35;
int T, n, k, l, d[maxn];
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d %d %d", &n, &k, &l);
    for (int i = 1; i <= n; ++i) scanf("%d", d + i);
    bool flag = true;
    int t = 0;
    d[0] = -2e9;
    for (int i = 1; i <= n; ++i) {
      if (d[i] > l) flag = false;
      int first = l - d[i];
      if (first >= k) continue;
      if (d[i - 1] + k <= l) {
        if (first == 0)
          t = 0;
        else
          t = 2 * k - first;
      } else {
        if (t >= k) {
          if (first == 0)
            t = 0;
          else
            t = max(t + 1, 2 * k - first);
          t = t % (2 * k);
        } else {
          t += 1;
          if (d[i] + t > l) flag = false;
        }
      }
    }
    if (flag)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
