#include <bits/stdc++.h>
using namespace std;
long long a, n, k, l, m, las, p;
int main() {
  cin >> a;
  for (int i = 0; i < a; i++) {
    p = 1;
    las = 0;
    cin >> n >> k >> l;
    for (int j = 0; j < n; j++) {
      cin >> m;
      if (m > l)
        p = 0;
      else if (m + k <= l)
        las = 0;
      else if (las < k)
        las = max(las + 1, k - (l - m));
      else {
        if (k + (l - m) < las + 1)
          p = 0;
        else
          las++;
      }
    }
    if (p == 1)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
