#include <bits/stdc++.h>
using namespace std;
int arr[512345];
int mark[512345];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k, d;
  cin >> n >> k >> d;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
    mark[i] = n;
  }
  mark[n] = n;
  sort(arr, arr + n);
  int last = 0;
  for (int i = n - k; i >= 0; --i) {
    int right = mark[i + k] - 1;
    if (arr[right] - arr[i] <= d) {
      mark[i] = i;
    } else {
      mark[i] = mark[i + 1];
    }
  }
  cout << (mark[0] == 0 ? "YES" : "NO") << '\n';
  return 0;
}
