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