#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
long long mod = 1000000007;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
bool is_vowel(char c) {
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') return 1;
  return 0;
}
double getDistance(double x1, double y1, double x2, double y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
long long extended_euclidean(long long a, long long b, long long &x,
                             long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long g = extended_euclidean(b, a % b, y, x);
  y -= (a / b) * x;
  return g;
}
long long power(long long base, long long p) {
  if (p == 1) return base;
  if (!p) return 1ll;
  long long ret = power(base, p / 2);
  ret *= ret;
  ret %= mod;
  if (p & 1) ret *= base;
  return ret % mod;
}
pair<long long, long long> vec(pair<long long, long long> a,
                               pair<long long, long long> b) {
  pair<long long, long long> ret =
      pair<long long, long long>(a.first - b.first, a.second - b.second);
  return ret;
}
long long getArea(pair<long long, long long> a, pair<long long, long long> b,
                  pair<long long, long long> c) {
  pair<long long, long long> x = vec(a, b);
  pair<long long, long long> y = vec(c, b);
  return abs(x.first * y.second - x.second * y.first);
}
bool intersect(const complex<double> &a, const complex<double> &b,
               const complex<double> &p, const complex<double> &q,
               complex<double> &ret) {
  double d1 = ((conj(p - a) * (b - a)).imag());
  double d2 = ((conj(q - a) * (b - a)).imag());
  ret = (d1 * q - d2 * p) / (d1 - d2);
  return fabs(d1 - d2) > 1e-9;
}
double getDistance(complex<double> a, complex<double> b) {
  return sqrt((a.real() - b.real()) * (a.real() - b.real()) +
              (a.imag() - b.imag()) * (a.imag() - b.imag()));
}
int bit[N];
bool can[N];
int get(int idx) {
  int ret = 0;
  idx++;
  while (idx > 0) {
    ret += bit[idx];
    idx -= idx & -idx;
  }
  return ret;
}
void update(int idx) {
  idx++;
  while (idx < N) {
    bit[idx]++;
    idx += idx & -idx;
  }
}
int main() {
  int n, k, d;
  cin >> n >> k >> d;
  vector<int> v(n);
  for (int i = (0); i <= (n - 1); ++i) scanf("%d", &v[i]);
  sort(v.begin(), v.end());
  for (int i = (k - 1); i <= (n - 1); ++i) {
    int lft = (lower_bound(v.begin(), v.end(), v[i] - d) - v.begin());
    if (i - lft + 1 < k) continue;
    lft--;
    int rgt = i - k + 1;
    int query = get(rgt - 1) - get(lft - 1);
    if (lft < 0) query = 1;
    if (query > 0) {
      can[i] = 1;
      update(i);
    }
  }
  if (can[n - 1])
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
