#include <bits/stdc++.h>
using namespace std;
int n, k, d;
int a[500010];
int dp[500010];
int c[500010];
void update(int k) {
  while (k <= n) {
    c[k]++;
    k |= k + 1;
  }
};
int sum(int k) {
  int ret = 0;
  while (k >= 0) {
    ret += c[k];
    k = ((k + 1) & k) - 1;
  }
  return ret;
}
int get(int l, int r) {
  if (l > r) return 0;
  return sum(r) - sum(l - 1);
}
int main() {
  cin >> n >> k >> d;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1, less<int>());
  int l = 0;
  dp[0] = 1;
  update(0);
  for (int i = 1; i <= n; i++) {
    while (l < i && a[i] - a[l] > d) l++;
    dp[i] = get(l - 1, i - k) >= 1 ? 1 : 0;
    if (dp[i]) update(i);
  }
  cout << (dp[n] ? "YES" : "NO") << endl;
}
