#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC target("avx")
long long t, n, a[300005], l, k;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> t;
  while (t--) {
    cin >> n >> k >> l;
    for (long long i = 1; i <= n; i++) cin >> a[i];
    a[0] = -k;
    a[n + 1] = -k;
    long long t = k;
    long long h;
    long long f = 0;
    for (long long i = 0; i <= n; i++) {
      if (f) break;
      if (t >= k) {
        if (a[i] + k <= l) {
          long long de = l - a[i + 1];
          if (de < 0) f = 1;
          de = min(k, de);
          t = 2 * k - de;
          t %= (2 * k);
        } else {
          h = 2 * k - t;
          long long de = a[i + 1] + h - l;
          de = max(de, 1LL);
          if (de > h) {
            f = 1;
          }
          t += de;
          t %= (2 * k);
        }
      } else {
        h = t;
        if (a[i] + k <= l) {
          long long de = l - a[i + 1];
          if (de < 0) f = 1;
          de = min(k, de);
          t = 2 * k - de;
          t %= (2 * k);
        } else if (a[i + 1] + h + 1 <= l) {
          t++;
          t %= (2 * k);
        } else
          f = 1;
      }
    }
    if (f)
      cout << "No";
    else
      cout << "Yes";
    cout << endl;
  }
}
