#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t, n, k, l;
  cin >> t;
  while (t--) {
    cin >> n >> k >> l;
    int time_limit = 2 * k;
    vector<int> d(n);
    for (int &x : d) cin >> x;
    vector<int> p;
    for (int i = 0; i <= k; i++) p.emplace_back(i);
    for (int i = k - 1; i > 0; i--) p.emplace_back(i);
    vector<vector<int>> grid(n, vector<int>(time_limit, 0));
    for (int i = 0; i < n; i++)
      for (int j = 0; j < 2 * k; j++) grid[i][j] = d[i] + p[j];
    vector<vector<bool>> ans(n, vector<bool>(time_limit, false));
    for (int j = 0; j < 2 * k; j++)
      if (grid[0][j] <= l) {
        ans[0][j] = true;
      }
    for (int i = 1; i < n; i++) {
      for (int j = 0; j < 2 * k; j++)
        if (ans[i - 1][(j - 1 + time_limit) % time_limit] && grid[i][j] <= l)
          ans[i][j] = true;
      for (int j = 0; j < 2 * k; j++) {
        if (ans[i][j]) {
          for (int pre = (j + 1) % time_limit; pre != j;) {
            if (ans[i][(pre - 1 + time_limit) % time_limit] &&
                grid[i][pre] <= l)
              ans[i][pre] = true;
            pre = (pre + 1) % time_limit;
          }
          break;
        }
      }
    }
    bool check = false;
    for (int j = 0; j < time_limit; j++)
      if (ans[n - 1][j]) check = true;
    cout << (check ? "Yes" : "No");
    cout << "\n";
  }
}
