#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e5 + 4;
int sz[MAXN];
int main() {
  int n, k;
  cin >> n >> k;
  int pre = 0;
  int x;
  int ans = 0;
  vector<int> tmp;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (abs(x - pre) <= k) {
      ans++;
      pre = x;
      tmp.push_back(x);
    }
  }
  cout << ans << "\n";
  return 0;
}
