#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
const int SQRTN = 320;
const int LOGN = 20;
int a[N], n, k, d, ans[N];
bool seg[N * 3], dp[N];
int G(int x) {
  int s = 1, e = n, mid = 0, best = 0;
  while (s <= e) {
    mid = s + e >> 1;
    if (a[mid] < x)
      s = mid + 1;
    else
      best = mid, e = mid - 1;
  }
  return best;
}
bool update(int n, int s, int e, int idx) {
  if (s == e) return seg[n] = 1;
  int mid = s + e >> 1;
  if (mid < idx)
    update((n << 1) + 1, mid + 1, e, idx);
  else
    update(n << 1, s, mid, idx);
  seg[n] = seg[n << 1] || seg[(n << 1) + 1];
  return seg[n];
}
bool get(int n, int s, int e, int l, int r) {
  if (s > r || e < l) return 0;
  if (s >= l && e <= r) return seg[n];
  int mid = s + e >> 1;
  return get(n << 1, s, mid, l, r) || get((n << 1) + 1, mid + 1, e, l, r);
}
int main() {
  cin >> n >> k >> d;
  for (int i = 0; i < n; i++) scanf("%d", a + i + 1);
  sort(a + 1, a + n + 1);
  dp[1] = 1;
  update(1, 1, n, 1);
  for (int i = 1; i <= n; i++) {
    int v = G(a[i] - d);
    if (i - v + 1 < k) continue;
    int last = i - k + 1;
    dp[i + 1] = get(1, 1, n, v, last);
    if (dp[i + 1]) update(1, 1, n, i + 1);
  }
  cout << (dp[n + 1] ? "YES" : "NO") << endl;
  return 0;
}
