#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 1e-3;
const int MAXN = 5e5 + 10;
const int MAXM = 1e4 + 10;
const long long mod = 1e9;
int a[MAXN], dp[MAXN];
int main() {
  int n, k, d;
  scanf("%d%d%d", &n, &k, &d);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  int l = -1;
  for (int i = k - 1; i < n; i++) {
    if (a[i] - a[l + 1] <= d) dp[i] = 1;
    if (dp[i - k + 1]) l = i - k + 1;
  }
  if (dp[n - 1])
    puts("YES");
  else
    puts("NO");
  return 0;
}
