#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 10;
const int M = 1000;
const int K = 10;
const int LG = 21;
const long long mod = 1e9 + 7;
string merge(string a, string b, int m) {
  string null(m, '0');
  for (int i = 0; i < m; ++i) null[i] = '0' + bool(a[i] == '1' || b[i] == '1');
  return null;
}
int solve() {
  int n, k, d;
  scanf("%d%d%d", &n, &k, &d);
  vector<int> a(n);
  for (auto& x : a) cin >> x;
  sort(a.begin(), a.end());
  int j = 0;
  vector<char> used(n + 1);
  for (int i = k; i <= n; ++i) {
    while (i - j > k && (a[i - 1] - a[j] > d || j != 0 && !used[j])) j++;
    used[i] = a[i - 1] - a[j] <= d && (j == 0 || used[j]);
  }
  cout << (used.back() ? "YES" : "NO");
  return 0;
}
int main() {
  solve();
  return 0;
}
