#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 100;
int n, k, d;
int a[N];
struct node {
  int l, r, maxn;
} tree[N << 2];
void init(int i, int l, int r) {
  tree[i] = (node){l, r, 0};
  if (l == r) return;
  int mid = l + r >> 1;
  init((i << 1), l, mid);
  init((i << 1 | 1), mid + 1, r);
  return;
}
void upd(int i, int pos, int val) {
  if (tree[i].l == tree[i].r) {
    tree[i].maxn = val;
    return;
  }
  int mid = tree[i].l + tree[i].r >> 1;
  if (mid >= pos)
    upd((i << 1), pos, val);
  else
    upd((i << 1 | 1), pos, val);
  tree[i].maxn = max(tree[(i << 1)].maxn, tree[(i << 1 | 1)].maxn);
  return;
}
int qy(int i, int l, int r) {
  if (tree[i].l >= l && tree[i].r <= r) return tree[i].maxn;
  int mid = tree[i].l + tree[i].r >> 1;
  int ans = 0;
  if (l <= mid) ans = max(ans, qy((i << 1), l, r));
  if (r > mid) ans = max(ans, qy((i << 1 | 1), l, r));
  return ans;
}
int main() {
  scanf("%d%d%d", &n, &k, &d);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  sort(a + 1, a + n + 1);
  init(1, 1, n);
  for (int i = n - k + 1; i >= 1; i--) {
    int t = upper_bound(a + 1, a + n + 1, a[i] + d) - a;
    t--;
    if (t == n) {
      upd(1, i, 1);
      continue;
    }
    if (i + k > t + 1) continue;
    upd(1, i, qy(1, i + k, t + 1));
  }
  if (qy(1, 1, 1) == 1)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
