#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, k, l;
    cin >> n >> k >> l;
    vector<int> d(n + 1);
    for (int i = 1; i <= n; ++i) cin >> d[i];
    auto p = [&](int i) {
      if (i <= k)
        return i;
      else
        return k - (i - k);
    };
    vector<vector<bool>> dp(n + 1, vector<bool>(2 * k, false));
    fill(dp[0].begin(), dp[0].end(), true);
    for (int i = 1; i <= n; ++i) {
      for (int j = 0; j < 2 * k; ++j) {
        dp[i][j] =
            (d[i] + p(j) <= l) && (dp[i - 1][(j - 1 + 2 * k) % (2 * k)] ||
                                   dp[i][(j - 1 + 2 * k) % (2 * k)]);
      }
      dp[i][0] = dp[i][0] || ((d[i] + p(0) <= l) && dp[i][2 * k - 1]);
    }
    bool ans = (find(dp[n].begin(), dp[n].end(), true) != dp[n].end());
    cout << (ans ? "YES" : "NO") << "\n";
  }
  return 0;
}
