#include <bits/stdc++.h>
using namespace std;
const long long int N = 3e5 + 10, M = 10, MOD = 1e9 + 7, INF = 1e18 + 10;
long long int t, n, k, l, a[N], pos, ti;
bool ok, cur;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n >> k >> l;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    ok = cur = 1;
    ti = k;
    for (int i = 0; i < n; i++) {
      long long int dif = l - a[i];
      if (cur) {
        if (0 <= dif) {
          if (k <= dif) {
            ti = k;
          } else if (dif <= ti - 1) {
            ti = dif;
          } else if (ti <= dif) {
            if (0 < ti)
              ti--;
            else if (dif < 1) {
              ok = 0;
              break;
            } else {
              ti = 1;
              cur = 0;
            }
          }
        } else {
          ok = 0;
          break;
        }
      } else {
        long long int dif2 = l - a[i];
        if (0 <= dif2) {
          if (ti + 1 <= dif2) {
            if (k <= dif2) {
              ti = k;
              cur = 1;
            } else {
              ti++;
            }
          } else {
            ok = 0;
            break;
          }
        } else {
          ok = 0;
          break;
        }
      }
    }
    if (ok)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
