#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
int a[N] = {0};
int max_length[N];
int ans = 0;
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int now = 0;
  for (int i = 1; i <= n; i++) {
    if (abs(a[i] - now) <= k) {
      ans++;
      now = a[i];
    }
  }
  cout << ans << endl;
  return 0;
}
