#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
int n, k, d, a[1000005];
bool f[1000005];
int l = 0, r = 0, cnt = 1;
inline void del(int x) {
  if (f[x]) cnt--;
}
inline void add(int x) {
  if (f[x]) cnt++;
}
int main() {
  n = read();
  k = read();
  d = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  sort(a + 1, a + n + 1);
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    while (a[i] - a[l + 1] > d) del(l), l++;
    while (r < i - k) r++, add(r);
    if (i >= k) f[i] = (cnt > 0);
  }
  printf((f[n] == 1) ? "YES\n" : "NO\n");
  return 0;
}
