#include <bits/stdc++.h>
using namespace std;
long long n, k;
long long a[300001];
long long calcu(long long mid) {
  long long l = mid - 1, r = mid + 1;
  long long cntl = 0, cntr = 0;
  while (l >= 0) {
    if (abs(a[l] - a[l + 1]) <= k) cntl++;
    l--;
  }
  while (r < n) {
    if (abs(a[r] - a[r - 1]) <= k) cntr++;
    r++;
  }
  return cntl + cntr + 1;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (n % 2 == 0) {
    long long x = n / 2, y = x - 1;
    cout << max(calcu(x), calcu(y)) << endl;
  } else {
    long long x = n / 2;
    cout << calcu(x) << endl;
  }
  return 0;
}
