#include <bits/stdc++.h>
using namespace std;
const int NMAX = 5e5 + 7;
int n, k, d, a[NMAX], dp[NMAX];
struct Tree {
  int trrre[4 * NMAX];
  void update(int node, int st, int en, int idx, int val) {
    if (st > en || idx > en || idx < st) return;
    if (st == en) {
      trrre[node] = val;
      return;
    }
    int mid = (st + en) / 2;
    update(2 * node, st, mid, idx, val);
    update(2 * node + 1, mid + 1, en, idx, val);
    trrre[node] = max(trrre[2 * node], trrre[2 * node + 1]);
  }
  int calc(int node, int st, int en, int l, int r) {
    if (l > en || r < st || st > en) return 0;
    if (l <= st && en <= r) return trrre[node];
    int mid = (st + en) / 2;
    return max(calc(2 * node, st, mid, l, r),
               calc(2 * node + 1, mid + 1, en, l, r));
  }
} T;
int main() {
  cin >> n >> k >> d;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  T.update(1, 0, n, 0, 1);
  int go = 0;
  for (int i = 0; i < n; i++) {
    while (go < i && a[i] - a[go] > d) go++;
    if (T.calc(1, 0, n, go, i - k + 1)) T.update(1, 0, n, i + 1, 1);
  }
  if (T.calc(1, 0, n, n, n))
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
