#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:336777216")
using namespace std;
const double pi = atan((double)1.0) * 4;
long long MOD = (long long)1e9 + 7;
long long power(long long n, long long k) {
  if (k == 0)
    return 1;
  else if (k == 1)
    return n;
  else {
    if (k % 2 == 0) {
      return power((n * n) % MOD, k / 2);
    } else {
      return (power((n * n) % MOD, k / 2) * n) % MOD;
    }
  }
}
long long modInv(long long n) { return power(n, MOD - 2); }
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
template <class T>
bool reverse_sort(T a, T b) {
  return a > b;
}
long long arr[(long long)5e5 + 3];
long long dp_from[(long long)5e5 + 3];
long long dp_to[(long long)5e5 + 3];
long long segment[(long long)2e6 + 14] = {0};
long long lazy[(long long)2e6 + 14] = {0};
void update(long long l, long long r, long long idx) {
  if (lazy[idx] == 1) {
    segment[idx] = 1;
    if (l != r) {
      lazy[2 * idx] = 1;
      lazy[2 * idx + 1] = 1;
    }
    lazy[idx] = 0;
  }
}
long long value(long long l, long long r, long long idx, long long target) {
  update(l, r, idx);
  if (l == r) {
    return segment[idx];
  } else {
    long long mid = (l + r) / 2;
    if (target <= mid)
      return value(l, mid, 2 * idx, target);
    else
      return value(mid + 1, r, 2 * idx + 1, target);
  }
}
void update_ft(long long l, long long r, long long f, long long t,
               long long idx) {
  update(l, r, idx);
  if (l == f && r == t) {
    lazy[idx] = 1;
    return;
  } else {
    long long mid = (l + r) / 2;
    if (t <= mid) {
      update_ft(l, mid, f, t, 2 * idx);
    } else if (f >= mid + 1) {
      update_ft(mid + 1, r, f, t, 2 * idx + 1);
    } else {
      update_ft(l, mid, f, mid, 2 * idx);
      update_ft(mid + 1, r, mid + 1, t, 2 * idx + 1);
    }
    return;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k, d;
  cin >> n >> k >> d;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  sort(arr + 1, arr + n + 1);
  for (int i = 1; i <= n; i++) {
    auto it = upper_bound(arr + i, arr + n + 1, arr[i] + d);
    dp_from[i] = i + k;
    dp_to[i] = it - arr;
  }
  for (int i = 1; i <= n; i++) {
    long long now = value(1, n + 1, 1, i);
    if (i == 1) now = 1;
    if (now == 1 && dp_from[i] <= dp_to[i]) {
      update_ft(1, n + 1, dp_from[i], dp_to[i], 1);
    }
  }
  long long ans = value(1, n + 1, 1, n + 1);
  if (ans == 1)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
