#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int T;
  cin >> T;
  while (T--) {
    long long int n, k, l;
    cin >> n >> k >> l;
    vector<long long int> arr(n);
    for (long long int i = 0; i < n; i++) cin >> arr[i];
    arr.push_back(-2e9 + 10);
    bool bo = true;
    long long int pt = 0;
    for (long long int i = 0; i < n + 1; i++) {
      if (arr[i] > l) bo = false;
      if (arr[i] + k <= l) {
        long long int val = k;
        bool down = false;
        for (long long int j = pt; j < i; j++) {
          if (!down) {
            val--;
            val -= max((long long int)0, arr[j] + val - l);
            if (val == 0) down = true;
          } else {
            val++;
            if (val + arr[j] > l) bo = false;
          }
        }
        pt = i + 1;
      }
    }
    if (bo)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
