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