#include <bits/stdc++.h>
using namespace std;
long long nxt() {
  long long x;
  cin >> x;
  return x;
}
void setIO(string s) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}
void yes() { cout << "YES\n"; }
void no() {
  cout << "NO\n";
  exit(0);
}
const long long mod = 1e9 + 7;
const long long INF = 2e9;
struct SegTree {
  long long int n;
  vector<long long int> t, a, lazy;
  SegTree(long long int _n) {
    n = _n;
    t.resize(4 * (n + 3), INF);
    a.resize(n + 3, INF);
    lazy.resize(4 * (n + 3), 0);
  }
  void push(long long int v) {
    t[v * 2] += lazy[v];
    lazy[v * 2] += lazy[v];
    t[v * 2 + 1] += lazy[v];
    lazy[v * 2 + 1] += lazy[v];
    lazy[v] = 0;
  }
  void update(long long int v, long long int tl, long long int tr,
              long long int l, long long int r, long long int addend) {
    if (r < tl || l > tr) return;
    if (l <= tl && tr <= r) {
      t[v] += addend;
      lazy[v] += addend;
    } else {
      push(v);
      long long int tm = (tl + tr) / 2;
      update(v * 2, tl, tm, l, r, addend);
      update(v * 2 + 1, tm + 1, tr, l, r, addend);
      t[v] = min(t[v * 2], t[v * 2 + 1]);
    }
  }
  long long int query(long long int v, long long int tl, long long int tr,
                      long long int l, long long int r) {
    if (r < tl || l > tr) return INF;
    if (l <= tl && tr <= r) return t[v];
    push(v);
    long long int tm = (tl + tr) / 2;
    return min(query(v * 2, tl, tm, l, r), query(v * 2 + 1, tm + 1, tr, l, r));
  }
};
void solve() {
  long long int n, k, d;
  cin >> n >> k >> d;
  vector<long long int> a(n);
  for (long long int i = (long long int)(0); i < (long long int)(n); i++)
    cin >> a[i];
  sort(a.begin(), a.end());
  SegTree seg(n + 1);
  if (a[k - 1] - a[0] > d) no();
  seg.update(1, 0, n, 0, 0, 0 - INF);
  42;
  for (long long int i = (long long int)(0); i < (long long int)(n); i++) {
    42;
    long long int has = seg.query(1, 0, n, i + 1, i + 1);
    long long int l = lower_bound(a.begin(), a.end(), a[i] - d) - a.begin();
    long long int r = i - k + 1;
    l--, r--;
    l = max(l, -1LL);
    r = max(r, -1LL);
    42;
    long long int cur = INF;
    if (l <= r && i - r >= k) {
      cur = seg.query(1, 0, n, l + 1, r + 1) + 1;
    }
    42;
    seg.update(1, 0, n, i + 1, i + 1, cur - has);
    42;
    42;
  }
  42;
  seg.query(1, 0, n, n, n) == INF ? no() : yes();
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << fixed << setprecision(10);
  long long int T = 1;
  for (long long int tc = 1; tc <= T; tc++) {
    solve();
  }
}
