#include <bits/stdc++.h>
using namespace std;
int n, k, d, v[500005];
bool dp[500005];
int main() {
  int i, j, Max = 0;
  cin >> n >> k >> d;
  for (i = 1; i <= n; ++i) cin >> v[i];
  sort(v + 1, v + n + 1);
  dp[0] = 1, Max = 0;
  j = 1;
  for (i = 1; i <= n; ++i) {
    if (i >= k)
      if (dp[i - k] == 1) Max = i - k;
    while (j < i && v[i] - v[j] > d) ++j;
    if (i - j + 1 >= k && Max + 1 >= j) dp[i] = 1;
  }
  if (dp[n])
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
