#include <bits/stdc++.h>
using namespace std;
const int maxn = 500005;
int n, pos, k, d;
int a[maxn], f[maxn];
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);
  f[0] = 1;
  for (int i = 0; i <= n; i++)
    if (f[i] == 1) {
      pos = max(pos, i + k);
      while (pos <= n && a[pos] - a[i + 1] <= d) f[pos] = 1, pos++;
    }
  puts(f[n] == 0 ? "NO" : "YES");
  return 0;
}
