#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 0;
  cin >> t;
  while (t--) {
    int n, k, l, flag = 0;
    cin >> n >> k >> l;
    vector<int> depth(n, 0);
    for (int i = 0; i < n; i++) cin >> depth[i];
    vector<int> maxl(n, 0), minl(n, 0);
    for (int i = 0; i < n; i++) {
      if (depth[i] > l) {
        flag = 1;
        break;
      }
      maxl[i] = min(l - depth[i], k);
      minl[i] = max((-1) * k, (-1) * maxl[i]);
    }
    int j = minl[0];
    for (int i = 1; i < n; i++) {
      if (maxl[i - 1] == k) {
        j = minl[i];
      } else if (maxl[i] >= j + 1) {
        minl[i] = max(minl[i], j + 1);
        j = max(minl[i], j + 1);
      } else {
        flag = 1;
        break;
      }
    }
    string s = flag == 0 ? "Yes" : "No";
    cout << s << endl;
  }
  return 0;
}
