#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> v(n);
  for (int& x : v) cin >> x;
  int cur = v[0];
  int c = 0;
  for (int i = 1; i < (int)v.size(); i++) {
    if (abs(cur - v[i]) <= k) c++;
    cur = v[i];
  }
  cout << c + 1 << endl;
}
