#include <bits/stdc++.h>
using namespace std;
int lg(long long n) {
  assert(n > 0);
  int ans = -1;
  while (n) {
    ans++;
    n >>= 1;
  }
  return ans;
}
struct fenwick {
  int n;
  vector<long long> fen;
  fenwick(int _n) : n(_n), fen(n) {}
  fenwick(const vector<long long> &a) {
    n = (int)a.size();
    fen.resize(n);
    for (int i = 0; i < n; i++) {
      add(i, a[i]);
    }
  }
  void add(int pos, long long val) {
    for (int i = pos; i < n; i |= (i + 1)) {
      fen[i] += val;
    }
  }
  long long prefixsum(int pos) {
    long long ans = 0;
    for (int i = pos; i >= 0; i = (i & (i + 1)) - 1) {
      ans += fen[i];
    }
    return ans;
  }
  long long rangesum(int l, int r) { return prefixsum(r) - prefixsum(l - 1); }
  long long getele(int pos) { return prefixsum(pos) - prefixsum(pos - 1); }
};
void solve() {
  int n, k, d;
  cin >> n >> k >> d;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  fenwick bit(n + 1);
  bit.add(0, 1);
  for (int l = 0, r = 0; r < n; r++) {
    int rb = r + 1 - k;
    while (l < r && a[r] - a[l] > d) l++;
    if (rb >= l && bit.rangesum(l, rb)) bit.add(r + 1, 1);
  }
  if (bit.getele(n))
    cout << "YES" << '\n';
  else
    cout << "NO" << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
