#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 7;
bool dp[maxn];
int sum[maxn], n, k, d, a[maxn];
int main() {
  scanf("%d%d%d", &n, &k, &d);
  for (int i = (1); i <= (n); i++) scanf("%d", a + i);
  dp[0] = 1;
  sum[0] = 0;
  sort(a + 1, a + n + 1);
  for (int i = (k); i <= (n); i++) {
    int t = lower_bound(a + 1, a + n + 1, a[i] - d) - a - 1;
    dp[i] = 0;
    if (t == 0)
      dp[i] = 1;
    else if (t <= i - k)
      dp[i] = (bool)(sum[i - k] - sum[t - 1]);
    sum[i] = sum[i - 1] + (int)dp[i];
  }
  if (dp[n])
    puts("YES");
  else
    puts("NO");
  return 0;
}
