#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  cin >> a[0];
  int ans = 1;
  for (int(i) = (1); (i) < (n); ++(i)) {
    cin >> a[i];
    if (abs(a[i - 1] - a[i]) <= k) ans++;
  }
  cout << ans << "\n";
}
