#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 500;
int a[maxn], dp[maxn];
queue<int> q;
int main() {
  int n, k, d;
  while (~scanf("%d%d%d", &n, &k, &d)) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    sort(a + 1, a + n + 1);
    dp[0] = 1;
    while (!q.empty()) q.pop();
    for (int i = k; i <= n; i++) {
      if (dp[i - k]) q.push(i - k + 1);
      while (!q.empty() && a[i] - a[q.front()] > d) q.pop();
      if (!q.empty())
        dp[i] = 1;
      else
        dp[i] = 0;
    }
    if (dp[n])
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
