#include <bits/stdc++.h>
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int a[n];
  int b[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int cnt = 0;
  b[0] = a[0];
  cnt++;
  for (int i = 1; i < n; i++) {
    if (abs(a[i] - b[cnt - 1]) <= k) {
      b[cnt] = a[i];
      cnt++;
    }
  }
  printf("%d\n", cnt);
}
