#include <bits/stdc++.h>
using namespace std;
int num[105];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, k, l;
    cin >> n >> k >> l;
    bool flag = true;
    int now = 0;
    int tmp = 1;
    for (int i = 1; i <= n; i++) {
      cin >> num[i];
      num[i] = l - num[i];
    }
    int a = k + 1, b = -1;
    for (int i = 1; i <= n; i++) {
      if (num[i] < 0)
        flag = false;
      else if (num[i] >= k)
        a = k + 1, b = -1;
      else if (b == -1)
        a = min(a + b, num[i]);
      else {
        a += b;
        if (a > num[i]) {
          flag = false;
        }
      }
      if (a == 0) b = 1;
    }
    if (flag) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
