#include <bits/stdc++.h>
using namespace std;
const int Maxn = 5e5 + 5;
int n, k, d;
int a[Maxn];
bool t[1 << 20];
bool dp[Maxn];
void pushup(int p) {
  t[p] = t[((p << 1) + 1)] || t[((p << 1) + 2)];
  if (p) pushup((p - 1) / 2);
  return;
}
void update(int pos, bool val, int p = 0, int l = 0, int r = (1 << 19) - 1) {
  if (l == r) {
    t[p] = val;
    pushup((p - 1) / 2);
    return;
  }
  int mi = (l + r) >> 1;
  if (pos <= mi)
    update(pos, val, ((p << 1) + 1), l, mi);
  else
    update(pos, val, ((p << 1) + 2), mi + 1, r);
}
bool query(int a, int b, int p = 0, int l = 0, int r = (1 << 19) - 1) {
  if (a <= l && r <= b) return t[p];
  int mi = (l + r) >> 1;
  bool rez = 0;
  if (mi >= a) rez = rez || query(a, b, ((p << 1) + 1), l, mi);
  if (mi < b) rez = rez || query(a, b, ((p << 1) + 2), mi + 1, r);
  return rez;
}
int main() {
  memset(t, 0, sizeof t);
  memset(dp, 0, sizeof dp);
  scanf("%d%d%d", &n, &k, &d);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  sort(a + 1, a + n + 1);
  update(0, true);
  for (int i = 1; i <= n; i++) {
    int lb = lower_bound(a + 1, a + n + 1, a[i] - d) - a;
    int a = lb - 1, b = i - k;
    if (a <= b) {
      dp[i] = query(a, b);
      update(i, dp[i]);
    }
  }
  if (dp[n])
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
