#include <bits/stdc++.h>
using namespace std;
long long n, k, d, dp[5 * 100000 + 5], x[5 * 100000 + 5], cdp[5 * 100000 + 5],
    a[5 * 100000 + 5];
int main() {
  scanf("%lld %lld %lld", &n, &k, &d);
  for (long long i = 1; i <= n; ++i) scanf("%lld", &a[i]);
  if (k == 1) {
    printf("YES");
    return 0;
  }
  sort(a + 1, a + n + 1);
  a[n + 1] = (1LL << 60);
  dp[n + 1] = 1;
  cdp[n + 1] = 1;
  cdp[n] = 1;
  long long ptr = n;
  x[n] = 1;
  for (long long i = n - 1; i >= 1; --i) {
    while (a[ptr] - a[i] > d) --ptr;
    x[i] = ptr - i + 1;
    if (n - i + 1 < k) {
      dp[i] = 0;
      cdp[i] = 1;
      continue;
    }
    if (x[i] < k) {
      dp[i] = 0;
      cdp[i] = cdp[i + 1];
      continue;
    }
    if (cdp[i + k] - cdp[i + x[i] + 1]) {
      dp[i] = 1;
      cdp[i] = 1 + cdp[i + 1];
      continue;
    } else {
      dp[i] = 0;
      cdp[i] = cdp[i + 1];
    }
  }
  if (dp[1])
    printf("YES");
  else
    printf("NO");
  return 0;
}
