#include <bits/stdc++.h>
using namespace std;
int n, k, l;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    cin >> n >> k >> l;
    vector<int> safe, d(n + 1);
    d.clear();
    safe.clear();
    safe.push_back(0);
    for (int i = 1; i <= n; i++) {
      cin >> d[i];
      if (d[i] + k <= l) {
        safe.push_back(i);
      }
    }
    safe.push_back(n + 1);
    int f = 1;
    for (int i = 1; i < safe.size(); i++) {
      int t = k;
      int down = 1;
      for (int j = safe[i - 1] + 1; j < safe[i]; j++) {
        if (down == 1)
          t -= 1;
        else
          t += 1;
        if (down == 1) t -= max(0, d[j] + t - l);
        if (t < 0 || d[j] + t > l) {
          f = 0;
          break;
        }
        if (t == 0) down = 0;
      }
      if (f == 0) break;
    }
    if (f)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
