#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a[n];
  for (int i = 0; i < n; ++i) cin >> a[i];
  vector<int> ans;
  for (int i = 1; i < n; ++i)
    if (abs(a[i] - a[i - 1]) <= k) ans.push_back(a[i - 1]);
  if (abs(a[n - 1] - ans.back()) <= k) ans.push_back(a[n - 1]);
  cout << ans.size();
  return 0;
}
