#include <bits/stdc++.h>
using namespace std;
int a[300005], b[300005];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, k, m;
    cin >> n >> k >> m;
    int h = 0;
    b[0] = 0;
    int flag = 0;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      if (a[i] + k <= m) b[++h] = i;
      if (a[i] > m) flag = 1;
    }
    if (flag == 1) {
      cout << "No" << endl;
      continue;
    }
    b[++h] = n + 1;
    for (int i = 0; i < h; i++) {
      if (b[i + 1] - b[i] <= 2) continue;
      int l = b[i] + 1;
      int r = b[i + 1] - 1;
      int x = r - l + 1;
      if (x >= 2 * k) {
        flag = 1;
        break;
      }
      int w = m - a[l];
      int v = 0;
      if (w == 0) v = 1;
      for (int j = l + 1; j <= r; j++) {
        int s = m - a[j];
        if (v == 0) {
          w--;
          w = min(w, s);
          if (w == 0) v = 1;
        } else {
          w++;
          if (s < w) {
            flag = 1;
            break;
          }
        }
      }
    }
    if (flag == 1)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
