#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, i, j, x, y, z, ans = 0;
  string s;
  bool flag;
  vector<long long> v;
  ;
  cin >> m >> n;
  j = m;
  while (j--) {
    cin >> x;
    v.push_back(x);
  }
  if (v.size() == 1) {
    cout << 1 << endl;
  } else {
    for (i = 1; i < v.size(); i++) {
      if (abs(v[i - 1] - v[i]) <= n) ans++;
    }
  }
  cout << ans + 1 << endl;
}
