#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using pii = pair<int, int>;
int a[500010], dp[500010], s[500010];
int sum(int l, int r) { return s[r] - (l >= 1 ? s[l - 1] : 0); }
int main() {
  ios_base::sync_with_stdio(false);
  int i, n, k, d, l, r;
  cin >> n >> k >> d;
  for (i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + n + 1);
  dp[0] = s[0] = 1;
  for (i = 1; i <= n; ++i) {
    l = lower_bound(a + 1, a + n + 1, a[i] - d) - a;
    r = i - k + 1;
    if (1 <= l && l <= r && sum(l - 1, r - 1) > 0) dp[i] = 1;
    s[i] = s[i - 1] + dp[i];
  }
  cout << (dp[n] ? "YES\n" : "NO\n");
  return 0;
}
