#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5;
int wei[maxn], tou[maxn], a[maxn], n, k, d;
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);
  wei[0] = 1;
  tou[1] = 1;
  int e = 1;
  for (int s = 1; s <= n; s++) {
    if (tou[s] == 1) {
      while (a[e] - a[s] <= d && e <= n) {
        if (e - s + 1 >= k) {
          wei[e] = 1;
          tou[e + 1] = 1;
        }
        e++;
      }
    }
  }
  if (wei[n] == 1)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
