#include <bits/stdc++.h>
using namespace std;
const int N = 300005;
int d[N];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n, k, l;
    scanf("%d%d%d", &n, &k, &l);
    for (int i = 1; i <= n; ++i) {
      scanf("%d", &d[i]);
    }
    vector<int> v;
    v.push_back(0);
    for (int i = 1; i <= n; ++i) {
      if (d[i] + k <= l) v.push_back(i);
    }
    v.push_back(n + 1);
    bool flag = true;
    for (int i = 1; i < v.size(); ++i) {
      bool down = true;
      int tide = k;
      for (int j = v[i - 1] + 1; j < v[i]; ++j) {
        tide += down ? -1 : 1;
        if (down) {
          if (d[j] + tide > l) {
            int diff = d[j] + tide - l;
            tide -= diff;
          }
        }
        if (tide < 0 || d[j] + tide > l) {
          flag = false;
          break;
        }
        if (tide == 0) {
          down = false;
        }
      }
      if (!flag) break;
    }
    if (flag) {
      puts("Yes");
    } else {
      puts("No");
    }
  }
  return 0;
}
