#include <bits/stdc++.h>
using namespace std;
long long n, k, d;
int ps[500010];
bool works[500010];
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k >> d;
  for (int i = 1; i <= n; ++i) {
    cin >> ps[i];
  }
  sort(ps + 1, ps + n + 1);
  queue<int> solvable;
  works[0] = true;
  for (int i = k; i <= n; ++i) {
    if (works[i - k]) solvable.push(i - k);
    while (!solvable.empty() && ps[i] - ps[solvable.front() + 1] > d)
      solvable.pop();
    if (!solvable.empty()) works[i] = true;
  }
  cout << (works[n] ? "YES" : "NO");
  return 0;
}
