#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fll;
const int N = 3e5 + 10;
const int M = 1e6 + 10;
const int maxn = 50 * 50 + 10;
const int mod = 998244353;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
int n, k, l;
int d[N];
vector<int> ve;
void work() {
  cin >> n >> k >> l;
  ve.clear();
  ve.push_back(0);
  for (int i = 1; i <= n; i++) {
    cin >> d[i];
    if (d[i] + k <= l) ve.push_back(i);
  }
  ve.push_back(n + 1);
  for (int i = 1; i < ((int)ve.size()); i++) {
    int high = k;
    bool down = 1;
    for (int j = ve[i - 1] + 1; j < ve[i]; j++) {
      high += down ? -1 : 1;
      if (down) high -= max(0, high + d[j] - l);
      if (high < 0 || high + d[j] > l) {
        cout << "No\n";
        return;
      }
      if (!high) down = 0;
    }
  }
  cout << "Yes\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) work();
  return 0;
}
