#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-10;
const long long MOD = 1e9 + 7;
const long long OO = 1e10;
const int N = 5e5 + 5;
int a[N];
bool dp[N];
int f[N];
void upd(int x) {
  for (int i = x; i < N; i |= i + 1) f[i]++;
}
int sum(int x) {
  int ret = 0;
  for (int i = x; i >= 0; i = (i & (i + 1)) - 1) ret += f[i];
  return ret;
}
int get(int l, int r) {
  if (l > r) return 0;
  return sum(r) - sum(l - 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k, d;
  cin >> n >> k >> d;
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  dp[0] = 1;
  upd(0);
  int j = 0;
  for (int i = 0; i < n; ++i) {
    while (j < i && a[i] - a[j] > d) j++;
    dp[i + 1] = (get(j, i - k + 1) >= 1);
    if (dp[i + 1]) upd(i + 1);
  }
  if (dp[n])
    cout << "YES";
  else
    cout << "NO";
}
