#include <bits/stdc++.h>
using namespace std;
const long long int inf = 1e18;
const long long int mod = 1e9 + 7;
const long long int mod2 = 998244353;
const long long int longinf = 1LL << 60;
const long double pi = acos(-1);
const long double phi = (sqrt(5) + 1) / 2;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ios::sync_with_stdio(0);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    int n, k, l;
    cin >> n >> k >> l;
    vector<int> d(n + 1), safe = {0};
    for (int i = 1; i <= n; i++) {
      cin >> d[i];
      if (k + d[i] <= l) safe.push_back(i);
    }
    safe.push_back(n + 1);
    bool flag = true;
    for (int i = 1; i < safe.size() && flag; i++) {
      int tide = k;
      bool des = 1;
      for (int j = safe[i - 1] + 1; j < safe[i]; j++) {
        tide += des ? -1 : +1;
        if (des) tide -= max(0, d[j] + tide - l);
        if (tide < 0 || d[j] + tide > l) {
          flag = false;
          break;
        }
        if (tide == 0) des = false;
      }
    }
    if (flag)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
