#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using ull = unsigned long long;
using int2 = pair<ll, ll>;
using int3 = tuple<ll, ll, ll>;
template <typename A>
string to_string(const A &v);
string to_string(const string &s) { return '"' + s + '"'; }
string to_string(const char *s) { return to_string((string)s); }
string to_string(char c) { return string(1, c); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(const pair<A, B> &p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A, typename B, typename C>
string to_string(const tuple<A, B, C> &p) {
  return "(" + to_string(std::get<0>(p)) + ", " + to_string(std::get<1>(p)) +
         ", " + to_string(std::get<2>(p)) + ")";
}
template <typename A>
string to_string(const A &v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <typename T>
void sort(vector<T> &val) {
  sort(val.begin(), val.end());
}
template <typename T>
void reverse(vector<T> &val) {
  reverse(val.begin(), val.end());
}
template <typename T>
void reverse(map<T, T> &val) {
  reverse(val.begin(), val.end());
}
template <typename T>
void sort_b(vector<T> &val) {
  sort(val.begin(), val.end(), greater<T>());
}
template <typename T>
T pair_sum(pair<T, T> &val) {
  return val.first + val.second;
}
template <typename T>
T min(T a, T b, T c) {
  return min(min(a, b), c);
}
template <typename T>
T max(T a, T b, T c) {
  return max(max(a, b), c);
}
template <typename T>
T mul_mod(T a, T b, T mod) {
  T res = 0;
  a %= mod;
  while (b) {
    if (b & 1) {
      res = (res + a) % mod;
    }
    a = (2 * a) % mod;
    b >>= 1;
  }
  return res;
}
template <typename T>
T fac_mod(T v, T mod) {
  ll res = 1;
  for (ll i = 1; i <= v; i++) {
    res *= i;
    res = res % mod;
  }
  return res;
}
template <typename T>
T pow_mod(T v, T p, T mod) {
  if (p == 1) return v;
  if (p % 2 == 0) {
    T t = pow_mod(v, p / 2, mod);
    return (t * t) % mod;
  } else {
    return (v * pow_mod(v, p - 1, mod)) % mod;
  }
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
class deq {
 public:
  deque<ll> v;
  bool reverse_f = false;
  deq(deque<ll> &iv) { v = iv; }
  void reverse() { reverse_f ^= 1; }
  ll back() {
    if (reverse_f)
      return v.front();
    else
      return v.back();
  }
  ll front() {
    if (reverse_f)
      return v.back();
    else
      return v.front();
  }
  void pop_back() {
    if (reverse_f)
      v.pop_front();
    else
      v.pop_back();
  }
};
class mytask {
 public:
  mytask() {}
  bool intersect(int2 a, int2 b) {
    if (a.first > b.first) {
      swap(a, b);
    }
    if (a.second < b.first) {
      return false;
    } else {
      return true;
    }
  }
  int solve() {
    ll t;
    cin >> t;
    while (t--) {
      ll n, k, l;
      cin >> n >> k >> l;
      vll a(n);
      for (ll i = 0; i < n; i++) {
        cin >> a[i];
      }
      ll max_t = k;
      ll min_t = -k;
      bool good = true;
      for (ll i = 0; i < n; i++) {
        if (a[i] > l) {
          good = false;
          break;
        }
        ll dif = l - a[i];
        if (dif >= k) {
          max_t = k;
          min_t = -k;
        } else {
          ll max_t_c = dif;
          ll min_t_c = -dif;
          if (!intersect({min_t, max_t}, {min_t_c, max_t_c})) {
            good = false;
            break;
          }
          min_t = max(min_t, min_t_c);
          max_t = max_t_c;
          min_t++;
          max_t++;
        }
      }
      cout << ((good) ? "Yes" : "No") << "\n";
    }
    return 0;
  }
};
int main() {
  auto task = mytask();
  task.solve();
  return 0;
}
