#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const double eps = 1e-7;
const int maxn = 3e5 + 9;
const double pi = acos(-1.0);
const long long inf = 1e17;
const long long mod = 1e9 + 7;
int op[maxn];
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int n, k, l, fg = 1;
    cin >> n >> k >> l;
    for (int i = 1; i <= n; ++i) cin >> op[i];
    pair<int, int> la(-k, k);
    for (int i = 1; i <= n; ++i) {
      if (op[i] > l || la.first >= l - op[i]) {
        fg = 0;
        break;
      }
      if (op[i] + k <= l)
        la = make_pair(-k, k);
      else {
        la = make_pair(max(la.first + 1, op[i] - l),
                       min(la.second + 1, l - op[i]));
        la.second = max(la.second, l - op[i]);
      }
    }
    if (fg)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
