#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
int dp[maxn];
int a[maxn];
int main() {
  int n, k, d;
  while (cin >> n >> k >> d) {
    memset(dp, 0, sizeof(dp));
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    dp[n] = 1;
    int r, l;
    for (int i = n - 1; i >= 0; i--) {
      r = upper_bound(a, a + n, a[i] + d) - a;
      l = i + k;
      if (l <= r)
        if (dp[l] - dp[r + 1]) dp[i] = 1;
      dp[i] += dp[i + 1];
    }
    if (dp[0] - dp[1])
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
