#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve() {
  int N, K;
  cin >> N >> K;
  vector<int> v(N);
  cin >> v[0];
  int cnt = 0;
  for (int i = (1); i < (N); ++i) {
    cin >> v[i];
    if (abs(v[i - 1] - v[i]) <= K) cnt++;
  }
  cout << ++cnt << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
}
