#include <bits/stdc++.h>
using namespace std;
int len[105];
int p[210];
int dp[105][40005];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n, k, l;
    memset(dp, 0, sizeof(dp));
    scanf("%d%d%d", &n, &k, &l);
    for (int i = 1; i <= n; i++) {
      scanf("%d", &len[i]);
    }
    for (int i = 0; i <= k; i++) {
      p[i] = i;
    }
    for (int i = 1; i < k; i++) {
      p[k + i] = k - i;
    }
    for (int j = 0; j < 2 * k; j++) {
      dp[0][j] = 1;
    }
    for (int i = 1; i <= n; i++) {
      for (int j = 0; j < 2 * k * n; j++) {
        dp[i][j] = max(dp[i][j - 1], dp[i - 1][j - 1]);
        if (l < p[j % (2 * k)] + len[i]) dp[i][j] = 0;
      }
    }
    int rec = false;
    for (int i = 0; i < 2 * k * n; i++) {
      if (dp[n][i]) rec = true;
    }
    if (rec)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
