#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f, oo = inf;
inline long long read() {
  register long long x = 0;
  char f = 0;
  register char c = getchar();
  for (; !isdigit(c); c = getchar()) f |= (c == '-');
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  return f ? -x : x;
}
inline double readdb() {
  register double x = 0, p = 0.1;
  register char f = 0, c = getchar();
  for (; !isdigit(c); c = getchar()) f |= (c == '-');
  for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48);
  if (c == '.')
    for (c = getchar(); isdigit(c); c = getchar(), p /= 10)
      x = x + (c ^ 48) * p;
  return f ? -x : x;
}
inline void write(long long x) {
  if (x < 0) x = -x, putchar('-');
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
inline void writeln(long long x) {
  write(x);
  puts("");
}
inline void writeln(long long x, char c, long long y) {
  write(x);
  putchar(c);
  writeln(y);
}
inline void writeln(long long x, char c, long long y, char d, long long z) {
  write(x);
  putchar(c);
  write(y);
  putchar(d);
  writeln(z);
}
int n, k, d, a[500005];
bool f[500005];
int q[500005];
int main() {
  n = read(), k = read(), d = read();
  for (register int i = (1); i <= (n); ++i) a[i] = read();
  sort(a + 1, a + 1 + n);
  f[0] = true;
  int front, rear;
  front = rear = 0;
  for (register int i = (k); i <= (n); ++i) {
    if (f[i - k]) q[rear++] = i - k + 1;
    while (front < rear && a[i] - a[q[front]] > d) front++;
    f[i] = front < rear;
  }
  if (f[n])
    puts("YES");
  else
    puts("NO");
  return 0;
}
