#include <bits/stdc++.h>
using namespace std;
template <typename T>
void input(vector<T> &arr, long long int n) {
  T temp;
  for (long long int i = 0; i < n; i++) cin >> temp, arr.push_back(temp);
}
template <typename T>
void output(vector<T> arr) {
  T temp;
  for (auto x : arr) cout << x << " ";
  cout << endl;
}
template <typename T>
void input_set(set<T> &arr, long long int n) {
  T temp;
  for (long long int i = 0; i < n; i++) cin >> temp, arr.insert(temp);
}
long long int power(long long int num, long long int base) {
  if (base == 0) return 1;
  if (base % 2)
    return (num % 1000000007 * power(num, base - 1) % 1000000007) % 1000000007;
  else {
    long long int x = power(num, base / 2);
    x = (x * x) % 1000000007;
    return x;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int testcases;
  cin >> testcases;
  while (testcases--) {
    long long int n, d[300005], k, l, i, j, p;
    bool yes = true;
    cin >> n >> k >> l;
    for (i = 0; i < n; i++) {
      cin >> d[i];
    }
    i = 0;
    long long int t = l - d[0] + 1;
    bool down = true;
    while (i < n) {
      j = l - d[i];
      if (j < 0) {
        yes = false;
        break;
      }
      if (j >= k) {
        p = i;
        if (i < n - 1) t = l - d[i + 1] + 1;
        ++i;
        down = true;
        continue;
      }
      if (down)
        t--;
      else
        t++;
      if (down && t + d[i] > l) {
        t = j;
      }
      if (t + d[i] > l) {
        yes = false;
        break;
      }
      if (t == 0) down = false;
      ++i;
    }
    cout << (yes ? "Yes" : "No") << endl;
  }
}
