#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, k, l;
  scanf("%d %d %d", &n, &k, &l);
  vector<int> a(n + 1), safe = {0};
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] + k <= l) {
      safe.push_back(i);
    }
  }
  safe.push_back(n + 1);
  for (int i = 1; i < int(safe.size()); i++) {
    int tide = k;
    bool down = true;
    for (int j = safe[i - 1] + 1; j < safe[i]; j++) {
      tide += down ? -1 : 1;
      if (down) {
        tide -= max(0, a[j] + tide - l);
      }
      if (tide < 0 || a[j] + tide > l) {
        puts("no");
        return;
      }
      if (tide == 0) down = false;
    }
  }
  puts("yes");
}
int main() {
  int tt;
  scanf("%d", &tt);
  while (tt--) {
    solve();
  }
}
