#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
inline bool uin(T &a, T b) {
  return a > b && (a = b, true);
}
template <class T>
inline bool uax(T &a, T b) {
  return a < b && (a = b, true);
}
struct Tree {
  static constexpr int unit = INT_MIN;
  static int f(int a, int b) { return a + b; }
  vector<int> s;
  int n;
  explicit Tree(int n = 0, int def = unit) : s(2 * n, def), n(n) {}
  void update(int pos, int val) {
    for (s[pos += n] = val; pos /= 2;) s[pos] = f(s[pos * 2], s[pos * 2 + 1]);
  }
  int query(int b, int e) {
    int ra = unit, rb = unit;
    for (b += n, e += n; b < e; b /= 2, e /= 2) {
      if (b % 2) ra = f(ra, s[b++]);
      if (e % 2) rb = f(s[--e], rb);
    }
    return f(ra, rb);
  }
};
class EPencilsAndBoxes {
  vector<int> A;
  int N, K, D;

 public:
  void solve(std::istream &cin, std::ostream &cout) {
    cin >> N >> K >> D;
    A.resize(N);
    for (int i = 0; i < N; ++i) cin >> A[i];
    sort(A.begin(), A.end());
    Tree st(N + 1, 0);
    st.update(0, 1);
    for (int l = 0, i = 0; i < N; ++i) {
      while (l < i && A[i] - A[l] > D) ++l;
      if (l > i - K + 1) continue;
      if ((st.query(l, i - K + 2) >= 1)) st.update(i + 1, 1);
    }
    cout << (st.query(N, N + 1) ? "YES" : "NO") << '\n';
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  EPencilsAndBoxes solver;
  std::istream &in(std::cin);
  std::ostream &out(std::cout);
  solver.solve(in, out);
  return 0;
}
