#include <bits/stdc++.h>
const int maxn = 5e5 + 5;
struct BinaryIndexedTree {
  int up;
  long long tree[maxn];
  void init(int u) {
    up = u;
    memset(tree, 0, sizeof(tree));
  }
  inline int lowbit(int x) { return (x & (-x)); }
  void update(int pos, long long val) {
    while (pos <= up) {
      tree[pos] += val;
      pos += lowbit(pos);
    }
  }
  long long calc(int pos) {
    long long ret = 0;
    while (pos) {
      ret += tree[pos];
      pos -= lowbit(pos);
    }
    return ret;
  }
} biTree;
int n, k, d, a[maxn];
bool dp[maxn];
int main() {
  scanf("%d%d%d", &n, &k, &d);
  biTree.init(n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  std::sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    if (i < k)
      dp[i] = false;
    else if (a[i] - a[1] <= d)
      dp[i] = true;
    else {
      int t = std::lower_bound(a + 1, a + n + 1, a[i] - d) - a - 1;
      if (t > i - k)
        dp[i] = false;
      else
        dp[i] = (biTree.calc(i - k) - biTree.calc(t - 1) > 0);
    }
    if (dp[i]) biTree.update(i, 1LL);
  }
  if (dp[n])
    puts("YES");
  else
    puts("NO");
  return 0;
}
