#include <bits/stdc++.h>
using namespace std;
int nn, n, k, l, d[105], ls, li, zj, over;
int main() {
  cin >> nn;
  for (int i = 0; i < nn; i++) {
    over = 0;
    cin >> n >> k >> l;
    li = 0;
    for (int j = 1; j <= n; j++) {
      cin >> ls;
      d[j] = 0 - ls + l;
    }
    zj = 0;
    for (int j = 1; j <= n; j++) {
      if (d[j] - k >= 0) {
        li = 0;
        zj = 0;
      } else {
        int step = 0;
        li = 0;
        zj = 0;
        for (int p = j; p <= n; p++) {
          if (d[p] - k >= 0) {
            j = p - 1;
            break;
          }
          li = k - d[p];
          if (li > step && zj == 0) {
            step = li;
          } else if (zj == 0) {
            step++;
          }
          if (zj) {
            step--;
            if (li > step) {
              over = 1;
              break;
            }
          }
          if (step == k) zj = 1;
          if (step > k) {
            over = 1;
            break;
          }
        }
      }
      if (over) break;
    }
    if (over) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
  return 0;
}
