#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
int a[300005];
int dp[300005];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (fabs(a[i] - a[i - 1]) <= k || i == 1) {
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
