#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, k, l;
    cin >> n >> k >> l;
    int wave = k;
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    bool flag = false;
    bool downwards = true;
    for (int i = 0; i < n; i++) {
      if (a[i] + k <= l) {
        wave = l - a[i];
        wave = min(k, wave);
      } else {
        if (downwards)
          wave--;
        else
          wave++;
        if (wave == -1) {
          wave = 1;
          downwards = false;
        }
        if (wave == k + 1) {
          wave = k - 1;
          downwards = true;
        }
        if (a[i] > l) flag = true;
        if (a[i] + wave > l) {
          if (downwards) {
            wave = min(l - a[i], wave);
            wave = min(k, wave);
          }
          if (a[i] + wave > l) flag = true;
        }
      }
    }
    if (!flag)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
