#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int maxn = 5e5 + 100;
int N, K, D, satu[maxn], f[maxn];
queue<int> q;
inline long long read() {
  long long s = 0, f = 1;
  char ch;
  for (; ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') f = -1;
  for (; ch >= '0' && ch <= '9'; ch = getchar())
    s = (s << 1) + (s << 3) + ch - '0';
  return s * f;
}
int main() {
  N = read(), K = read(), D = read();
  f[0] = 1;
  for (int i = 1; i <= N; ++i) satu[i] = read();
  sort(satu + 1, satu + N + 1);
  for (int i = K; i <= N; ++i) {
    if (f[i - K]) q.push(i - K + 1);
    while (!q.empty() && abs(satu[q.front()] - satu[i]) > D) q.pop();
    f[i] = (!q.empty()) ? 1 : 0;
  }
  (f[N]) ? (puts("YES")) : puts("NO");
  return 0;
}
