#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
void solve();
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int t = 1;
  while (t--) {
    solve();
  }
}
void solve() {
  int n, k;
  cin >> n >> k;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int length = 0;
  int start = a[0];
  for (int i = 1; i < n; i++) {
    if (abs(a[i] - start) <= k) length++;
    start = a[i];
  }
  cout << length + 1;
}
