#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, z, k, w, d;
int A[500005];
int bits[500005];
int query(int x, int y) {
  if (x == 0) return 1;
  int res = 0;
  for (int i = y; i > 0; i -= (i & -i)) res += bits[i];
  for (int i = x - 1; i > 0; i -= (i & -i)) res -= bits[i];
  return res;
}
void update(int pos) {
  for (int i = pos; i <= n; i += (i & -i)) bits[i]++;
}
int main() {
  scanf("%d %d %d", &n, &k, &d);
  for (int i = (1); i <= (n); i++) scanf("%d", &A[i]);
  sort(A + 1, A + 1 + n);
  x = 1;
  for (int i = (1); i <= (n); i++) {
    while (A[i] - A[x] > d) x++;
    y = i - k + 1;
    if (x <= y && query(x - 1, y - 1) >= 1) update(i);
  }
  if (query(n, n) == 1)
    puts("YES");
  else
    puts("NO");
  return 0;
}
