#include <bits/stdc++.h>
using namespace std;
const long long maxn = 5e5 + 50;
const long long mod = 1073676287;
const long long base = 1e6;
long long st[4 * maxn];
struct tk {
  long long get(long long id, long long left, long long right, long long x,
                long long y) {
    if (left > y || right < x) return 0;
    if (x <= left && right <= y) {
      return st[id];
    }
    long long mid = (left + right) / 2;
    return (get(id * 2, left, mid, x, y) +
            get(id * 2 + 1, mid + 1, right, x, y));
  }
  void update(long long id, long long left, long long right, long long pos,
              long long diff) {
    if (pos < left || pos > right) return;
    if (left == right) {
      st[id] = diff;
      return;
    }
    long long mid = (left + right) / 2;
    update(id * 2, left, mid, pos, diff);
    update(id * 2 + 1, mid + 1, right, pos, diff);
    st[id] = (st[id * 2] + st[id * 2 + 1]);
  }
} man;
long long a[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  if (fopen("t.inp", "r")) {
    freopen("test.inp", "r", stdin);
    freopen("test.out", "w", stdout);
  }
  long long n, k, d;
  cin >> n >> k >> d;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  man.update(1, 1, n + 1, n + 1, 1);
  long long nw = n;
  for (int i = n; i >= 1; i--) {
    while (a[nw] - a[i] > d) nw--;
    long long ed = nw + 1;
    long long kc = n - i + 1;
    if (kc < k) continue;
    long long st = i + k;
    long long h = man.get(1, 1, n + 1, st, ed);
    if (h) {
      man.update(1, 1, n + 1, i, 1);
    }
  }
  if (man.get(1, 1, n + 1, 1, 1)) {
    cout << "YES"
         << "\n";
  } else {
    cout << "NO"
         << "\n";
  }
}
