#include <bits/stdc++.h>
using namespace std;
inline int f(int j, int k) {
  int ans = j % (2 * k);
  if (ans > k) {
    return 2 * k - ans;
  } else {
    return ans;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  for (int u = 0; u < t; ++u) {
    int n, k, l;
    cin >> n >> k >> l;
    vector<int> d(n);
    for (int i = 0; i < n; ++i) {
      cin >> d[i];
    }
    vector<vector<int> > dp(n + 2, vector<int>(5 * k, 0));
    for (int i = 0; i < 5 * k; ++i) {
      dp[0][i] = 1;
    }
    for (int i = 1; i < n + 1; ++i) {
      if (d[i - 1] <= l && dp[i - 1][2 * k - 1]) {
        dp[i][0] = 1;
      }
      for (int j = 1; j < 5 * k; ++j) {
        if (d[i - 1] + f(j, k) <= l && (dp[i][j - 1] || dp[i - 1][j - 1])) {
          dp[i][j] = 1;
        }
      }
      if (d[i - 1] <= l && dp[i][2 * k - 1]) {
        dp[i][0] = 1;
      }
    }
    bool f = 0;
    for (int i = 0; i < 5 * k; ++i) {
      if (dp[n][i]) {
        f = 1;
        break;
      }
    }
    cout << ((f) ? "Yes\n" : "No\n");
  }
}
