#include <bits/stdc++.h>
using namespace std;
int abs(int num) { return num < 0 ? -1 * num : num; }
int main() {
  int n, k, pre, post, count;
  cin >> n >> k;
  cin >> pre;
  count = 1;
  --n;
  while (n--) {
    cin >> post;
    if (abs(post - pre) <= k) {
      pre = post;
      ++count;
    }
  }
  cout << count << endl;
  return 0;
}
