#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
int a[N], f[N];
int n, k, d;
int main() {
  cin >> n >> k >> d;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n);
  int l = 1, r = 1;
  f[0] = 1;
  while (l <= n && r <= n) {
    if (f[l - 1] == 0) {
      l++;
      continue;
    }
    while (r - l + 1 < k && r <= n) r++;
    while (a[r] - a[l] <= d && r <= n) {
      f[r] = 1;
      r++;
    }
    l++;
  }
  if (f[n] == 0)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
