#include <bits/stdc++.h>
using namespace std;
bool vis[105][105][2];
int d[105];
int n, k, l;
bool go(int pos, int inc, bool up) {
  if (pos == n + 1) {
    return 1;
  }
  if (up) {
    inc++;
    if (inc == k) {
      up = 0;
    }
  } else {
    inc--;
    if (inc == 0) {
      up = 1;
    }
  }
  if (pos >= 1 && d[pos] + inc > l) {
    return 0;
  }
  if (vis[pos][inc][up]) {
    return 0;
  }
  vis[pos][inc][up] = 1;
  if (go(pos, inc, up)) {
    return 1;
  }
  if (go(pos + 1, inc, up)) {
    return 1;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    cin >> n >> k >> l;
    for (int i = 1; i <= n; i++) {
      cin >> d[i];
    }
    memset(vis, 0, sizeof(vis));
    bool ans = go(0, 0, 1);
    if (ans) {
      cout << "Yes"
           << "\n";
    } else {
      cout << "No"
           << "\n";
    }
  }
}
