#include <bits/stdc++.h>
using namespace std;
const int maxn = 505000;
template <typename T>
void read(T& x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  x *= f;
}
template <typename T, typename... Args>
void read(T& x, Args&... args) {
  read(x), read(args...);
}
template <typename T>
void write(T x) {
  if (x < 0) putchar('-'), write(-x);
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
int n, k, d, a[maxn];
set<pair<int, int> > st;
struct BIT {
  int c[maxn];
  inline void add(int x, int dd) {
    for (; x <= n; x += ((x) & (-(x)))) c[x] += dd;
  }
  inline int pref(int x) {
    int ret = 0;
    for (; x; x -= ((x) & (-(x)))) ret += c[x];
    return ret;
  }
  inline int sum(int l, int r) { return pref(r) - pref(l - 1); }
} bit;
int main() {
  read(n, k, d);
  for (int i = 1; i <= n; ++i) read(a[i]);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; ++i) st.emplace(a[i], i);
  for (int i = k; i <= n; ++i) {
    int r = i - k;
    auto it = st.lower_bound({a[i] - d, 0});
    int l = it->second;
    l--;
    if (l > r) continue;
    if (l == 0 || bit.sum(l, r) > 0) bit.add(i, 1);
  }
  puts(bit.sum(n, n) == 1 ? "YES" : "NO");
  return 0;
}
