#include <bits/stdc++.h>
using namespace std;
long long int t, n, l, k, descanso, prof, MAX;
long long int arr[300002];
bool res, bajada;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> t;
  for (int T = (1); T <= (t); T++) {
    cin >> n >> k >> l;
    descanso = l - k;
    for (int i = (1); i <= (n); i++) {
      cin >> arr[i];
      if (arr[i] <= descanso) arr[i] = -1;
    }
    res = true;
    arr[0] = -1;
    for (int i = (1); i <= (n); i++) {
      if (arr[i] > -1) {
        if (arr[i - 1] == -1) {
          prof = l - arr[i];
          if (prof < 0) {
            res = false;
            break;
          }
          bajada = true;
        }
        MAX = l - arr[i];
        if (MAX >= 0) {
          if ((arr[i] + prof) <= l) {
            if (prof == 0) bajada = false;
            if (bajada)
              prof--;
            else
              prof++;
          } else if (bajada) {
            prof = MAX;
            if (prof == 0) bajada = false;
            if (bajada)
              prof--;
            else
              prof++;
          } else {
            res = false;
            break;
          }
        } else {
          res = false;
          break;
        }
      }
    }
    if (res)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
