#include <bits/stdc++.h>
using namespace std;
long long D[500010];
long long head[500010];
long long n, k, d;
long long a[500010];
int main() {
  cin >> n >> k >> d;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + 1 + n);
  if (a[k] - a[1] <= d) {
    D[k] = 1;
    head[k] = 1;
  }
  for (int end = k + 1; end <= n; end++) {
    int start = end - k + 1;
    if (a[end] - a[start] <= d && D[start - 1] == 1) {
      D[end] = 1;
      head[end] = start;
      continue;
    }
    if (D[end - 1] == 1 && a[end] - a[head[end - 1]] <= d) {
      D[end] = 1;
      head[end] = head[end - 1];
    }
  }
  if (D[n] == 1) {
    cout << "YES" << endl;
  } else
    cout << "NO" << endl;
  return 0;
}
