#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const int INF = 1000000000;
long long solverL(int N, int K, vector<int> A) {
  vector<long long> delta(N + 1);
  for (int i = 0; i < N; i++) {
    delta[i + 1] = A[i + 1] - A[i];
  }
  long long cnt = 0;
  long long ans = 0;
  for (int i = 0; i < N + 1; i++) {
    double rnd = (double)rand() / RAND_MAX;
    if (rnd > 0.1) {
      cnt += delta[i];
      if (abs(cnt) <= K) {
        cnt = 0;
        ans++;
      }
    }
  }
  return min(ans, (long long)N);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int N, K;
  cin >> N >> K;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  long long ks = 0;
  long long ans = 0;
  while (ks < 200) {
    chmax(ans, solverL(N, K, A));
    ks++;
  }
  cout << ans << endl;
}
