#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, a, temp, res = 1, p;
  cin >> n >> k;
  scanf("%d", &temp);
  p = n - 1;
  while (p--) {
    scanf("%d", &a);
    if (abs(a - temp) <= k) {
      res++;
      temp = a;
    }
  }
  cout << res;
  return 0;
}
