#include <bits/stdc++.h>
using namespace std;
const int N = 500000 + 15;
int a[N], b[N];
bool flag[N];
int k, n, d;
int main() {
  memset(b, 0, sizeof(b));
  cin >> n >> k >> d;
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  sort(a + 1, a + n + 1);
  for (int i = k; i <= n; i++) {
    int j = b[i - k] + 1;
    if (a[i] - a[j] <= d)
      b[i] = i;
    else
      b[i] = b[i - 1];
  }
  if (b[n] == n)
    puts("YES");
  else
    puts("NO");
  return 0;
}
