#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10, mod = 1e9 + 7;
void solve() {
  int n, k, d;
  cin >> n >> k >> d;
  int a[n + 1];
  a[0] = -mod;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  set<int> s;
  s.insert(0);
  for (int i = 1; i <= n; i++) {
    int id = lower_bound(a, a + i + 1, a[i] - d) - a - 1;
    auto it = s.lower_bound(id);
    if (it != s.end() && i - (*it) >= k) {
      s.insert(i);
    }
  }
  if (*s.rbegin() == n) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
