#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 50;
set<long long> g[21];
bool vis[21];
long long cnt = 0;
long long dfs(long long node) {
  long long ret = 1;
  vis[node] = true;
  for (auto to : g[node]) {
    if (!vis[to]) ret += dfs(to);
  }
  return ret;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long t;
  cin >> t;
  while (t--) {
    long long n, k, l;
    cin >> n >> k >> l;
    vector<long long> d(n + 1);
    d[0] = -LLONG_MAX;
    for (long long i = 0; i < n; i++) cin >> d[i + 1];
    bool ok = true;
    for (long long i = 0; i <= n;) {
      long long j = i + 1;
      long long ti = k;
      bool rising = false;
      while (j <= n) {
        if (d[j] + k <= l) {
          break;
        }
        long long x = l - d[j];
        if (x < 0) {
          ok = false;
          break;
        }
        if (rising == false) {
          if (x < ti) {
            ti = x;
          } else {
            ti--;
          }
          if (ti <= 0) rising = true;
        } else {
          if (x > ti) {
            ti++;
          } else {
            ok = false;
            break;
          }
        }
        j++;
      }
      if (!ok) break;
      i = j;
    }
    if (ok) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }
}
