#include <bits/stdc++.h>
const double Pi = 3.14159265;
const int N = 5e6 + 10;
const unsigned long long base = 163;
const int INF = 0x3f3f3f3f;
using namespace std;
int a[N];
pair<int, int> p[N];
bool dp[N];
int main() {
  int n, k, d;
  ios::sync_with_stdio(false);
  cin.tie(0);
  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;
  int tot = 0;
  a[n + 1] = INF;
  while (l <= r && l <= n) {
    if (abs(a[r] - a[l]) <= d)
      r++;
    else
      l++;
    if (r - l >= k) p[++tot].first = l, p[tot].second = r - 1;
  }
  dp[0] = 1;
  for (int i = 1; i <= tot; i++) {
    if (dp[p[i].first - 1]) dp[p[i].second] = 1;
  }
  if (dp[n])
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
