#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
void yes() {
  cout << "YES\n";
  return;
}
void no() {
  cout << "NO\n";
  return;
}
void out(long long int n) {
  cout << n << endl;
  return;
}
const int mxN = 1e5 + 1;
vector<int> adj[mxN];
bool ck[mxN];
void init() {}
void solve(int case_no) {
  int n, k;
  cin >> n >> k;
  int f = n;
  int p;
  cin >> p;
  int ans = 0;
  n--;
  while (n--) {
    int t;
    cin >> t;
    if (abs(t - p) > k) ans++;
    p = t;
  }
  cout << f - ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  srand(time(NULL));
  init();
  int t = 1;
  for (int i = 1; i <= t; i++) solve(i);
}
