#include <bits/stdc++.h>
using namespace std;
int t;
struct solution {
  string solve() {
    int n, k, l;
    cin >> n >> k >> l;
    int poz = 0, prevpoz = 0, sol = 1;
    for (int i = 1; i <= n; ++i) {
      int d;
      cin >> d;
      int r = l - d;
      if (r < 0) sol = 0;
      if (r >= k)
        poz = -1;
      else {
        poz = max(prevpoz + 1, k - r);
        if (poz > k + r) sol = 0;
      }
      prevpoz = poz;
    }
    if (!sol) return "No\n";
    return "Yes\n";
  }
};
int main() {
  cin >> t;
  while (t--) {
    solution x;
    cout << x.solve();
  }
  return 0;
}
