4 2 12
10 16 22 28
 10 3 1
5 5 5 6 6 7 8 8 8 9
 8 7 13
52 85 14 52 92 33 80 85
 10 5 293149357
79072863 760382815 358896034 663269192 233367425 32795628 837363300 46932461 179556769 763342555
 10 3 0
1 1 2 2 2 2 2 2 2 2
 10 4 28
5 5 6 6 30 30 32 33 50 55
 6 2 1
1 1 2 3 4 5
 6 3 3
1 1 1 1 1 5
 4 2 1
1 1 2 3
 6 3 2
1 2 3 3 4 5
 5 2 3
8 9 11 12 16
 10 3 3
1 1 2 4 5 6 9 10 11 12
 6 3 3
2 2 2 4 7 7
 3 2 257816048
1 999999999 999999999
 6 3 2
1 2 2 3 4 5
 9 3 2
1 2 2 3 4 5 6 7 7
 4 2 100
1 2 3 200
 7 3 3
6 8 9 10 12 13 14
 10 3 3
1 2 3 3 3 3 3 3 3 5
 10 4 9
47 53 33 48 35 51 18 47 33 11
 13 2 86
841 525 918 536 874 186 708 553 770 268 138 529 183
 7 3 3
1 2 4 6 7 8 10
 10 3 3
1 1 1 2 2 5 6 7 8 9
 6 2 2
1 2 3 4 6 7
 9 3 3
1 2 3 4 5 6 7 8 9
 18 2 86
665 408 664 778 309 299 138 622 229 842 498 389 140 976 456 265 963 777
 10 4 1
2 2 2 3 3 10 10 10 11 11
 3 2 76
44 5 93
 6 3 3
1 2 3 4 5 6
 8 4 5
1 1 1 1 1 9 9 9
 12 3 2
1 2 3 9 10 11 12 13 14 15 15 15
 8 3 6
1 2 3 3 4 7 11 11
 6 3 3
1 2 3 4 7 8
 10 4 15
20 16 6 16 13 11 13 1 12 16
 4 2 3
1 2 3 6
 7 3 3
1 1 3 4 4 4 7
 6 3 3
1 1 4 3 3 6
 6 3 4
1 2 3 4 6 7
 8 2 3
1 2 3 4 10 11 12 13
 6 2 2
2 3 4 5 6 8
 8 3 3
1 1 1 2 2 3 3 5
 18 3 1
1 1 1 2 2 3 5 5 5 6 6 7 9 9 9 10 10 11
 1 1 1
1
 16 2 2
3 3 3 4 5 6 7 9 33 33 33 32 31 30 29 27
 4 2 4
9 1 2 3
 3 2 2
6 7 7
 5 2 7
1 3 4 5 10
 5 2 9
3 8 9 14 20
 3 2 15
1 18 19
 5 2 3
1 2 3 4 100
 14 2 75
105 300 444 610 238 62 767 462 17 728 371 578 179 166
 7 3 3
1 2 3 4 4 5 5
 10 4 7
4 3 6 5 4 3 1 8 10 5
 6 3 4
1 1 3 5 8 10
 7 2 2
1 2 3 4 5 6 7
 15 8 57
40 36 10 6 17 84 57 9 55 37 63 75 48 70 53
 11 3 4
1 1 1 5 5 5 10 12 14 16 18
 8 3 6
1 2 3 3 7 4 11 11
 6 4 0
1 3 2 4 2 1
 5 2 3
5 7 7 7 10
 9 3 1
1 2 2 2 2 3 4 4 5
 11 3 1
1 1 2 2 3 3 3 4 4 5 5

YES
 YES
 NO
 NO
 NO
 YES
 YES
 NO
 YES
 YES
 NO
 YES
 YES
 NO
 YES
 YES
 NO
 NO
 YES
 NO
 YES
 NO
 YES
 YES
 YES
 YES
 YES
 NO
 YES
 NO
 YES
 YES
 NO
 YES
 YES
 YES
 YES
 YES
 YES
 YES
 YES
 YES
 YES
 YES
 NO
 YES
 YES
 YES
 NO
 NO
 YES
 YES
 YES
 NO
 YES
 NO
 NO
 YES
 NO
 YES
 YES
 YES

#include <bits/stdc++.h>
using namespace std;
struct node {
  long long key;
  long long val;
  int prior;
  int size;
  int freq;
  struct node* l;
  struct node* r;
};
typedef node* pnode;
inline long long max(long long a, long long b) { return ((a < b) ? b : a); }
inline int getsize(pnode node) { return ((node != NULL) ? (node->size) : 0); }
inline void updatesize(pnode node) {
  if (node != NULL)
    node->size = getsize(node->l) + getsize(node->r) + (node->freq);
}
void merge(pnode& t, pnode l, pnode r) {
  if (l == NULL || r == NULL)
    t = ((l != NULL) ? l : r);
  else if (l->prior > r->prior)
    merge(l->r, l->r, r), t = l;
  else
    merge(r->l, l, r->l), t = r;
  updatesize(t);
}
void split(pnode t, pnode& l, pnode& r, int key) {
  if (t == NULL)
    l = r = NULL;
  else if (t->key <= key)
    split(t->r, t->r, r, key), l = t;
  else
    split(t->l, l, t->l, key), r = t;
  updatesize(t);
}
void splitpos(pnode t, pnode& l, pnode& r, int pos, int add = 0) {
  if (!t) return void(l = r = NULL);
  int curr_pos = add + getsize(t->l);
  if (curr_pos <= pos)
    splitpos(t->r, t->r, r, pos, curr_pos + 1), l = t;
  else
    splitpos(t->l, l, t->l, pos, add), r = t;
  updatesize(t);
}
void insert(pnode& t, pnode toadd) {
  if (toadd == NULL) abort();
  if (t == NULL)
    t = toadd;
  else if (t->prior < toadd->prior)
    split(t, toadd->l, toadd->r, toadd->key), t = toadd;
  else if (t->key == toadd->key)
    (t->freq)++;
  else
    insert((toadd->key < t->key) ? (t->l) : (t->r), toadd);
  updatesize(t);
}
pnode createnode(long long key, long long val) {
  pnode newnode = (pnode)malloc(sizeof(node));
  newnode->key = key;
  newnode->val = val;
  newnode->prior = rand();
  newnode->size = 1;
  newnode->l = NULL;
  newnode->r = NULL;
  newnode->freq = 1;
  return newnode;
}
pnode find(pnode t, long long key) {
  if (t == NULL)
    return NULL;
  else if (t->key == key)
    return t;
  else
    return find((key < t->key) ? (t->l) : (t->r), key);
}
void erase(pnode& t, long long key) {
  if (t == NULL)
    return;
  else if (t->key == key) {
    if ((t->freq) >= 2)
      (t->freq)--;
    else
      merge(t, t->l, t->r);
  } else
    erase((key < t->key) ? (t->l) : (t->r), key);
  updatesize(t);
}
void inordertraversal(pnode arrtree, int arr[], int& pos) {
  if (arrtree == NULL) return;
  inordertraversal(arrtree->l, arr, pos);
  for (int i = 0; i < arrtree->freq; i++) {
    arr[pos++] = arrtree->key;
  }
  inordertraversal(arrtree->r, arr, pos);
}
pnode sort(int arr[], int n) {
  pnode arrtree = NULL;
  int i;
  for (i = 0; i < n; i++) {
    insert(arrtree, createnode(arr[i], 0));
  }
  int zero = 0;
  inordertraversal(arrtree, arr, zero);
  return arrtree;
}
int lesseqsz(pnode& root, int val) {
  pnode l, r;
  split(root, l, r, val);
  int ret = getsize(l);
  merge(root, l, r);
  return ret;
}
void printtree(pnode tree) {
  if (tree == NULL) return;
  printtree(tree->l);
  printf("%lld ", tree->key);
  printtree(tree->r);
}
pnode lower_bound(pnode& tree, int val) {
  pnode l, r, l1, r1;
  split(tree, l, r, val - 1);
  splitpos(r, l1, r1, 0);
  pnode ret = l1;
  merge(r, l1, r1);
  merge(tree, l, r);
  return ret;
}
int main() {
  int n, minsize, maxdiff, i;
  scanf("%d%d%d", &n, &minsize, &maxdiff);
  int* arr = (int*)malloc(n * sizeof(int));
  for (i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  pnode arrtree = sort(arr, n);
  int* maxjmpidx = (int*)malloc(n * sizeof(int));
  for (i = 0; i < n; i++) {
    maxjmpidx[i] = lesseqsz(arrtree, arr[i] + maxdiff);
  }
  pnode canbedonetree = NULL;
  for (i = 0; i < n; i++) {
    if (n - i >= minsize && arr[n - 1] - arr[i] <= maxdiff) {
      insert(canbedonetree, createnode(i, 0));
    }
  }
  for (i = n - minsize - 1; i >= 0; i--) {
    int minjmp = i + minsize;
    int maxjmp = maxjmpidx[i];
    pnode temp = lower_bound(canbedonetree, minjmp);
    if (temp != NULL && ((temp->key) <= maxjmp))
      insert(canbedonetree, createnode(i, 0));
  }
  if (find(canbedonetree, 0) == NULL)
    printf("NO");
  else
    printf("YES");
  return 0;
}
