#include <bits/stdc++.h>
using namespace std;
int n, k, d, tail;
int a[(500005)], f[(500005)], sum[(500005)], q[(500005)];
template <typename T>
void read(T& t) {
  t = 0;
  bool fl = true;
  char p = getchar();
  while (!isdigit(p)) {
    if (p == '-') fl = false;
    p = getchar();
  }
  do {
    (t *= 10) += p - 48;
    p = getchar();
  } while (isdigit(p));
  if (!fl) t = -t;
}
int main() {
  read(n), read(k), read(d);
  for (int i = 1; i <= n; i++) read(a[i]);
  sort(a + 1, a + n + 1);
  f[0] = 1;
  q[++tail] = 0;
  for (int i = 1; i <= n; i++) {
    int l = 1, r = tail, ans = 0;
    while (l <= r) {
      int mid = l + r >> 1;
      if (i - q[mid] >= k)
        ans = q[mid] + 1, l = mid + 1;
      else
        r = mid - 1;
    }
    if (ans == 0) continue;
    if (a[i] <= a[ans] + d) {
      f[i] = 1;
      q[++tail] = i;
    }
  }
  if (f[n] == 1) {
    puts("YES");
  } else
    puts("NO");
  return 0;
}
