#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n, k;
  cin >> n >> k;
  int old, now;
  cin >> old;
  int ans = 0;
  for (int i = 0; i < (n - 1); ++i) {
    cin >> now;
    if (abs(old - now) <= k) {
      ans++;
    }
    old = now;
  }
  cout << ans + 1 << endl;
}
