#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("omit-frame-pointer")
#pragma GCC optimize("unroll-loops")
const int MAXINT = 2147483640;
const long long MAXLL = 9223372036854775800LL;
const long long MAXN = 1000000;
const double pi = 3.1415926535897932384626433832795;
using namespace std;
long long x1[1000000];
long long t[4300000];
long long g[4300000];
set<pair<long long, long long> > st;
set<pair<long long, long long> >::iterator it;
void push(long long v) {
  t[v * 2] += g[v];
  t[v * 2 + 1] += g[v];
  g[v * 2 + 1] += g[v];
  g[v * 2] += g[v];
  g[v] = 0;
}
void modify(long long v, long long tl, long long tr, long long l, long long r,
            long long val) {
  if (l > r) return;
  if (tl == l and tr == r) {
    t[v] += val;
    g[v] += val;
  } else {
    long long tm = (tl + tr) / 2;
    push(v);
    modify(v * 2, tl, tm, l, min(r, tm), val);
    modify(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r, val);
    t[v] = max(t[v * 2], t[v * 2 + 1]);
  }
}
long long get(long long v, long long tl, long long tr, long long pos) {
  if (tl == tr) return t[v];
  long long tm = (tl + tr) / 2;
  push(v);
  if (pos <= tm)
    return get(v * 2, tl, tm, pos);
  else
    return get(v * 2 + 1, tm + 1, tr, pos);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  srand(time(0));
  long long n, k, d, kol, now, pos;
  long long l, r;
  cin >> n >> k >> d;
  for (int i = 1; i <= n; i++) {
    cin >> x1[i];
  }
  sort(x1 + 1, x1 + 1 + n);
  for (int i = 1; i <= n; i++) {
    st.insert({x1[i], i});
  }
  n++;
  modify(1, 1, n, 1, 1, 1);
  for (int i = 1; i < n; i++)
    if (get(1, 1, n, i)) {
      now = x1[i];
      it = st.lower_bound({x1[i] + d + 1, 0});
      if (it != st.end())
        pos = it->second;
      else
        pos = n;
      l = i + k;
      r = pos;
      if (l <= r) modify(1, 1, n, l, r, 1);
    }
  if (get(1, 1, n, n))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
