#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, k, l;
    cin >> n >> k >> l;
    vector<long long> v(n);
    for (long long i = 0; i < n; i++) {
      cin >> v[i];
    }
    vector<pair<long long, long long>> up(n, {-1, -1});
    vector<pair<long long, long long>> down(n, {-1, -1});
    if (v[0] > l) {
      cout << "No" << endl;
      continue;
    }
    if (k + v[0] <= l) {
      up[0] = {0, k};
      down[0] = {k, 0};
    } else {
      up[0] = {0, l - v[0]};
      down[0] = {l - v[0], 0};
    }
    bool pos = 1;
    for (long long i = 1; i < n; i++) {
      long long maxt = (l - v[i]);
      if (maxt < 0) {
        pos = 0;
        break;
      } else if (maxt >= k) {
        up[i] = {0, k};
        down[i] = {k, 0};
      } else {
        long long premint = up[i - 1].first;
        if (premint != -1 && premint + 1 <= maxt) {
          up[i] = {premint + 1, maxt};
        }
        premint = down[i - 1].first;
        if (premint != -1) {
          if (premint - 1 >= 0) {
            up[i] = {0, maxt};
            down[i] = {min(premint - 1, maxt), 0};
          } else if (maxt >= 1)
            up[i] = {1, maxt};
        }
        if (up[i].first == -1 && down[i].first == -1) {
          pos = 0;
          break;
        }
      }
    }
    if (pos)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
