#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  int k;
  cin >> n >> k;
  vector<int> v(n);
  for (auto &i : v) cin >> i;
  ;
  int cnt = 0;
  int x = v[0];
  for (int i = 0; i < n; i++) {
    if (abs(v[i] - x) <= k) {
      x = v[i];
      ++cnt;
    }
  }
  cout << cnt;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
    cout << '\n';
  }
  return 0;
}
