#include <bits/stdc++.h>
using namespace std;
const int maxn = 500100;
int n, k, d, a[maxn], can[maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k >> d;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  int last = 1;
  for (int i = 1; i <= n; i++) {
    if (i - k > 0 && can[i - k]) last = i - k + 1;
    if (i - last + 1 >= k && a[i] - a[last] <= d) can[i] = 1;
  }
  if (can[n])
    cout << "YES";
  else
    cout << "NO";
}
