#include <bits/stdc++.h>
const long long MOD = 1000000007;
const long long inf = 1e18;
using namespace std;
long long int modpow(long long int x, long long int n) {
  long long int res = 1;
  while (n > 0) {
    if (n & 1) res = res * x % MOD;
    x = x * x % MOD;
    n >>= 1;
  }
  return res;
}
long long int power(long long int x, long long int n) {
  long long int res = 1;
  while (n > 0) {
    if (n & 1) res = res * x;
    x = x * x;
    n >>= 1;
  }
  return res;
}
int check(std::vector<long long int> &v, long long int k, int n) {
  int flag = 1;
  int l = 0, r = n - 1;
  while (l <= r) {
    if (l == r) {
      int f1 = 1, f2 = 1;
      for (int i = l; i <= n - 1; i++) {
        if (v[i] < i - l) {
          f2 = 0;
          break;
        }
      }
      for (int i = l; i >= 0; i--) {
        if (v[i] < l - i) {
          f1 = 0;
          break;
        }
      }
      if (f1 && f2)
        return 1;
      else
        return 0;
    }
    int m = (l + r) / 2;
    int f1 = 1, f2 = 1;
    for (int i = m; i <= n - 1; i++) {
      if (v[i] < i - m) {
        f2 = 0;
        break;
      }
    }
    for (int i = m; i >= 0; i--) {
      if (v[i] < m - i) {
        f1 = 0;
        break;
      }
    }
    if (f1 == 0 && f2 == 0) {
      return 0;
    }
    if (f1 && f2) return 1;
    if (f1) {
      l = m + 1;
      continue;
    }
    if (f2) r = m;
  }
  return 0;
}
void solve() {
  int n;
  long long int k, l;
  cin >> n >> k >> l;
  std::vector<long long int> d(n + 2);
  for (int i = 1; i <= n; i++) {
    cin >> d[i];
  }
  std::vector<int> pos;
  pos.push_back(0);
  for (int i = 1; i <= n; i++) {
    if (d[i] + k <= l) {
      pos.push_back(i);
    }
  }
  pos.push_back(n + 1);
  int n1 = pos.size();
  for (int i = 0; i < n1 - 1; i++) {
    int x = pos[i], y = pos[i + 1];
    std::vector<long long int> v;
    for (int i = x; i <= y; i++) {
      if (i == 0)
        v.push_back(k);
      else if (i == n + 1) {
        v.push_back(k);
      } else
        v.push_back(l - d[i]);
    }
    int n2 = v.size();
    if (check(v, k, n2) == 0) {
      cout << "No\n";
      return;
    }
  }
  cout << "Yes\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int t = 1, tt = 1;
  cin >> t;
  while (tt <= t) {
    solve();
    tt++;
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
}
