#include <bits/stdc++.h>
using namespace std;
const int mxN = 300001;
int a[mxN];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  int ans = 0, d = 0;
  for (int i = 1; i <= n; ++i)
    if (fabs(a[i] - d) <= k) {
      d = a[i];
      ans++;
    }
  cout << ans;
  return 0;
}
