#include <bits/stdc++.h>
const int inf = 0x3f3f3f3f, Inf = 0x7fffffff;
const long long INF = 0x7ffffffffffffff;
template <typename _Tp>
_Tp gcd(const _Tp &a, const _Tp &b) {
  return (!b) ? a : gcd(b, a % b);
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) _Tp abs(const _Tp &a) {
  return a > 0 ? a : -a;
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) _Tp max(const _Tp &a, const _Tp &b) {
  return a < b ? b : a;
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) _Tp min(const _Tp &a, const _Tp &b) {
  return a < b ? a : b;
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) void chmax(_Tp &a, const _Tp &b) {
  (a < b) && (a = b);
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) void chmin(_Tp &a, const _Tp &b) {
  (a > b) && (a = b);
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) void read(_Tp &x) {
  register char ch(getchar());
  bool f(false);
  while (ch < 48 || ch > 57) f |= ch == 45, ch = getchar();
  x = ch & 15, ch = getchar();
  while (ch >= 48 && ch <= 57)
    x = (((x << 2) + x) << 1) + (ch & 15), ch = getchar();
  if (f) x = -x;
}
template <typename _Tp, typename... Args>
__inline__ __attribute__((always_inline)) void read(_Tp &t, Args &...args) {
  read(t);
  read(args...);
}
__inline__ __attribute__((always_inline)) int read_str(char *s) {
  register char ch(getchar());
  while (ch < 65 || ch > 122 || (ch > 90 && ch < 97)) ch = getchar();
  register char *tar = s;
  *tar = ch, ch = getchar();
  while ((ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122))
    *(++tar) = ch, ch = getchar();
  return tar - s + 1;
}
const int N = 500005;
bool f[N];
int a[N];
struct BIT {
  int c[N], n;
  __inline__ __attribute__((always_inline)) void add(int x, const int &C) {
    for (; x <= n; x += ((x) & (-x))) c[x] += C;
  }
  __inline__ __attribute__((always_inline)) int sum(int x) {
    int ans = 0;
    for (; x; x -= ((x) & (-x))) ans += c[x];
    return ans;
  }
} tr;
int main() {
  int n, k, d;
  read(n, k, d);
  for (int i = 1; i <= n; ++i) read(a[i]);
  std::sort(a + 1, a + n + 1);
  f[0] = true;
  tr.n = n;
  tr.add(1, 1);
  for (int i = 1; i <= n; ++i) {
    int l = std::lower_bound(a + 1, a + i, a[i] - d) - a, r = i - k + 1;
    if (l <= r) f[i] = !!(tr.sum(r) - (l > 1 ? tr.sum(l - 1) : 0));
    if (f[i]) tr.add(i + 1, 1);
  }
  printf(f[n] ? "YES\n" : "NO\n");
  return 0;
}
