#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n, k, l, i, j;
    cin >> n >> k >> l;
    long long flag = 1;
    vector<long long> v(n + 1), x;
    x.push_back(0);
    for (i = 1; i <= n; i++) {
      cin >> v[i];
      if (v[i] > l)
        flag = 0;
      else if (v[i] + k <= l) {
        x.push_back(i);
      }
    }
    if (flag == 0) {
      cout << "NO" << endl;
      continue;
    }
    x.push_back(n + 1);
    flag = 1;
    for (i = 1; i < x.size(); i++) {
      long long c;
      long long r = 0;
      for (j = x[i - 1] + 1; j < x[i]; j++) {
        long long d = l - v[j];
        if (r == 0) {
          c = -d;
          r = 1;
        } else
          c++;
        if (c >= -d && c <= d) {
          continue;
        } else {
          if (c < -d)
            c = -d;
          else {
            flag = 0;
            break;
          }
        }
      }
      if (flag == 0) break;
    }
    if (flag == 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
