#include <bits/stdc++.h>
using namespace std;
queue<pair<int, int> > q;
int n, k, d, cnt, cn = 1, a[500001];
bool dp[500001];
int main() {
  scanf("%d%d%d", &n, &k, &d);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  int l = 0, cnt = 0;
  dp[0] = 1;
  for (int i = k; i <= n; i++) {
    if (dp[i - k]) cnt++;
    while (a[i] - a[l + 1] > d && i - l >= k) {
      if (dp[l]) cnt--;
      l++;
    }
    if (cnt && a[i] - a[l + 1] <= d && i - l + 1 > k) dp[i] = 1;
  }
  if (dp[n])
    printf("YES");
  else
    printf("NO");
}
