#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
int a[N], caned[N], canst[N];
int main() {
  int n, k, d, st, ed;
  scanf("%d %d %d", &n, &k, &d);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  st = 1;
  ed = 1;
  memset(caned, 0, sizeof(caned));
  memset(canst, 0, sizeof(canst));
  caned[0] = 1;
  canst[1] = 1;
  while (ed <= n) {
    if (ed - st + 1 < k)
      ed++;
    else if (!canst[st] || a[ed] - a[st] > d)
      st++;
    else {
      caned[ed] = 1;
      canst[ed + 1] = 1;
      ed++;
    }
  }
  if (caned[n])
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
