#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 7;
const int mod = 1e9 + 7;
const long long inf = 1e18 + 4;
int T;
long long n, k, l;
int a[maxn];
long long d[maxn];
int main() {
  cin >> T;
  while (T--) {
    int flag = 1;
    scanf("%lld%lld%lld", &n, &k, &l);
    for (int i = 1; i <= n; i++) scanf("%lld", &d[i]);
    long long res = inf;
    for (int i = n; i >= 1; i--) {
      long long cc = l - d[i];
      if (cc < 0) {
        flag = 0;
        break;
      }
      if (cc >= k) {
        res = inf;
        continue;
      } else {
        res = min(2ll * k + cc, res - 1);
        if (res < 2ll * k - cc) {
          flag = 0;
          break;
        }
      }
    }
    if (flag == 0)
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}
