#include <bits/stdc++.h>
using namespace std;
int n, k, l, x, cr;
int main() {
  int tc;
  cin >> tc;
  for (; tc--;) {
    cin >> n >> k >> l;
    bool lol = false;
    cr = -k;
    for (int i = 0; i < n; i++) {
      cin >> x;
      if (lol) continue;
      if (x > l)
        lol = true;
      else {
        if (x + k <= l)
          cr = -k;
        else
          cr = max(cr + 1, x - l);
        if (cr + x > l) lol = true;
      }
    }
    if (lol)
      cout << "No\n";
    else
      cout << "Yes\n";
  }
}
