#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e5 + 5;
long long d[MAXN];
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    long long n, k, l;
    scanf("%lld%lld%lld", &n, &k, &l);
    for (int i = 1; i <= n; i++) scanf("%lld", &d[i]);
    vector<int> safe;
    safe.push_back(0);
    for (int i = 1; i <= n; i++) {
      if (d[i] + k <= l) safe.push_back(i);
    }
    safe.push_back(n + 1);
    bool flag = 1;
    for (int i = 1; i < (int)safe.size() && flag; i++) {
      long long tide = k;
      bool down = 1;
      for (int j = safe[i - 1] + 1; j < safe[i]; j++) {
        if (down)
          tide--;
        else
          tide++;
        if (down) tide -= max(0ll, d[j] + tide - l);
        if (tide < 0 || d[j] + tide > l) {
          flag = 0;
          break;
        }
        if (!tide) down = 0;
      }
    }
    if (flag)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
