#include <bits/stdc++.h>
using namespace std;
using ll = int;
using ld = long double;
using vl = vector<ll>;
using vvl = vector<vl>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using vb = vector<bool>;
using vs = vector<string>;
const ld eps = 1e-9;
void do_interval_stuff(set<pll>& s, pll p) {
  auto beginit = s.upper_bound(make_pair(p.first + 1, 0));
  beginit--;
  if (p.first > beginit->second) {
    beginit++;
  }
  auto endit = s.upper_bound(make_pair(p.second + 1, 0));
  endit--;
  p.first = min(p.first, beginit->first);
  p.second = max(p.second, endit->second);
  endit++;
  vpll change;
  for (auto it = beginit; it != endit; it++) {
    change.push_back(*it);
  }
  for (ll i = (0); i < (ll((change).size())); i++) {
    s.erase(change[i]);
  }
  s.emplace(p);
}
int main() {
  cin.sync_with_stdio(0);
  int n, k, d;
  cin >> n >> k >> d;
  vl a(n);
  for (ll& i : a) {
    cin >> i;
  }
  sort(begin(a), end(a));
  vpll reach(n);
  for (ll i = (0); i < (n); i++) {
    reach[i].first = i + k;
  }
  ll pointy = 0;
  for (ll i = (0); i < (n); i++) {
    if (a.back() - a[i] <= d) {
      pointy = n;
    } else {
      while (a[pointy] - a[i] <= d) {
        pointy++;
      }
    }
    reach[i].second = pointy;
  }
  if (reach[0].first > reach[0].second) {
    cout << "NO" << endl;
    return 0;
  }
  if (reach[0].second == n) {
    cout << "YES" << endl;
    return 0;
  }
  set<pll> intervals;
  intervals.emplace(0, 0);
  intervals.emplace(INT_MAX, INT_MAX);
  for (ll i = (0); i < (n); i++) {
    {
      if (reach[i].first > reach[i].second) {
        continue;
      }
      auto it = intervals.upper_bound(make_pair(i + 1, 0));
      if (it == intervals.begin()) {
        continue;
      }
      it--;
      if (it->second < i) {
        continue;
      }
      do_interval_stuff(intervals, reach[i]);
    }
    {
      auto it = intervals.rbegin();
      it++;
      if (it->second == n && it->first <= n) {
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
}
