#include <bits/stdc++.h>
using namespace std;
struct Node {
  Node* left;
  Node* right;
  long long lb, rb, sum, add;
};
Node* Empty = new Node{NULL, NULL, -1ll, -1ll, 0ll, 0ll};
Node* build(long long l, long long r) {
  if (l == r) return new Node{Empty, Empty, l, r, 0ll, 0ll};
  long long mid = (l + r) / 2ll;
  Node* L = build(l, mid);
  Node* R = build(mid + 1ll, r);
  return new Node{L, R, l, r, 0ll, 0ll};
}
void push(Node* v) {
  if (v == Empty) return;
  v->sum += (v->rb - v->lb + 1ll) * v->add;
  v->left->add += v->add;
  v->right->add += v->add;
  v->add = 0ll;
}
long long get(Node* v, long long l, long long r) {
  push(v);
  if (l > v->rb || r < v->lb) return 0ll;
  if (l <= v->lb && v->rb <= r) return v->sum;
  return get(v->left, l, r) + get(v->right, l, r);
}
void update(Node* v, long long l, long long r, long long k) {
  push(v);
  if (l > v->rb || r < v->lb) return;
  if (l <= v->lb && v->rb <= r) {
    v->add += k;
    push(v);
    return;
  }
  update(v->left, l, r, k);
  update(v->right, l, r, k);
  v->sum = v->left->sum + v->right->sum;
}
int main() {
  srand(1373737);
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k, d;
  cin >> n >> k >> d;
  vector<long long> arr(n + 1);
  for (int i = 0; i < n; i++) cin >> arr[i + 1];
  sort(arr.begin(), arr.end());
  Node* root = build(0ll, n);
  update(root, 0, 0, 1ll);
  for (int i = 1; i <= n; i++) {
    int pl = lower_bound(arr.begin(), arr.end(), arr[i] - d) - arr.begin();
    pl = max(1, pl);
    int pr = i - k + 1;
    pl--;
    pr--;
    if (pl > pr)
      update(root, i, i, 0ll);
    else {
      if (get(root, pl, pr) > 0ll)
        update(root, i, i, 1ll);
      else
        update(root, i, i, 0ll);
    }
  }
  if (get(root, n, n) == 1ll)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
