#include <bits/stdc++.h>
using namespace std;
struct Fast {
  Fast() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} fast;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T& val) {
  std::fill((T*)array, (T*)(array + N), val);
}
long long mod = 1000000007;
long long modpow(long long m, long long n, long long modvalue) {
  if (n == 0) return 1;
  if (n % 2 == 0) {
    long long t = modpow(m, n / 2, modvalue);
    return t * t % modvalue;
  } else {
    return modpow(m, n - 1, modvalue) * m % modvalue;
  }
}
long long moddiv(long long a, long long b, long long modvalue) {
  return (a * modpow(b, mod - 2, modvalue)) % modvalue;
}
const long long INF = 1LL << 60;
string change_binary(long long a) {
  string ret;
  for (int i = 31; i >= 0; i--) {
    ret += (a >> i & 1) + '0';
  }
  return ret;
}
long long nCkmod(long long n, long long k, long long modvalue) {
  long long numera = 1;
  for (int i = n; i > n - k; i--) {
    numera *= i;
    numera %= modvalue;
  }
  long long denomi = 1;
  for (long long i = 0; i < (k); i++) {
    denomi *= (i + 1);
    denomi %= modvalue;
  }
  return moddiv(numera, denomi, modvalue);
}
map<long long, long long> cnt;
void primeFactors(long long n) {
  while (n % 2 == 0) {
    cnt[2]++;
    n = n / 2;
  }
  for (int i = 3; i <= sqrt(n); i = i + 2) {
    while (n % i == 0) {
      cnt[i]++;
      n = n / i;
    }
  }
  if (n > 2) {
    cnt[n]++;
  }
}
vector<long long> dijkstra(vector<vector<pair<long long, long long>>> graph,
                           long long s) {
  vector<long long> ans(graph.size(), -1);
  priority_queue<pair<long long, long long>, vector<pair<long long, long long>>,
                 greater<pair<long long, long long>>>
      pq;
  pq.push({0, s});
  while (pq.size() > 0) {
    long long cur1 = 0;
    long long cur2 = 0;
    if (ans[pq.top().second] != -1) {
      pq.pop();
    } else {
      cur1 = pq.top().first;
      cur2 = pq.top().second;
      pq.pop();
      ans[cur2] = cur1;
      for (long long i = 0; i < graph[cur2].size(); i++) {
        pq.push({cur1 + graph[cur2][i].first, graph[cur2][i].second});
      }
    }
  }
  return ans;
}
vector<string> maze;
long long h, w;
bool check(long long y, long long x) {
  if (x < 0 || x >= w || y < 0 || y >= h || maze[y][x] == '#') {
    return false;
  }
  return true;
}
signed main() {
  long long n, k;
  cin >> n >> k;
  vector<long long> as(n);
  for (long long i = 0; i < (n); i++) {
    cin >> as[i];
  }
  long long now = as[0];
  long long ans = 1;
  for (long long i = 1; i < (n); i++) {
    if (abs(as[i] - now) <= k) {
      now = as[i];
      ans++;
    }
  }
  cout << ans << endl;
}
