#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  int prev, ans = 1;
  cin >> prev;
  for (int i = 0; i < n - 1; ++i) {
    int a;
    cin >> a;
    if (abs(a - prev) <= k) {
      ans++;
      prev = a;
    }
  }
  cout << ans << endl;
}
