#include <bits/stdc++.h>
using namespace std;
long long low(vector<long long> &a, long long b) {
  auto c = lower_bound(a.begin(), a.end(), b);
  long long d = c - a.begin();
  return d;
}
long long upp(vector<long long> &a, long long b) {
  auto c = upper_bound(a.begin(), a.end(), b);
  long long d = c - a.begin();
  return d;
}
template <class T>
void cou(vector<vector<T>> a) {
  long long b = a.size();
  long long c = a[0].size();
  for (long long i = 0; i < b; i++) {
    for (long long j = 0; j < c; j++) {
      cout << a[i][j];
      if (j == c - 1)
        cout << endl;
      else
        cout << ' ';
    }
  }
}
long long wari(long long a, long long b) {
  if (a % b == 0)
    return a / b;
  else
    return a / b + 1;
}
long long keta(long long a) {
  double b = a;
  b = log10(b);
  long long c = b;
  return c + 1;
}
long long souwa(long long a) { return a * (a + 1) / 2; }
long long gcm(long long a, long long b) {
  if (a % b == 0) return b;
  return gcm(b, a % b);
}
bool prime(long long a) {
  if (a < 2)
    return false;
  else if (a == 2)
    return true;
  else if (a % 2 == 0)
    return false;
  for (long long i = 3; i <= sqrt(a) + 1; i += 2) {
    if (a % i == 0) return false;
  }
  return true;
}
struct Union {
  vector<long long> par;
  Union(long long a) { par = vector<long long>(a, -1); }
  long long find(long long a) {
    if (par[a] < 0)
      return a;
    else
      return par[a] = find(par[a]);
  }
  bool same(long long a, long long b) { return find(a) == find(b); }
  long long Size(long long a) { return -par[find(a)]; }
  void unite(long long a, long long b) {
    a = find(a);
    b = find(b);
    if (a == b) return;
    if (Size(b) > Size(a)) swap<long long>(a, b);
    par[a] += par[b];
    par[b] = a;
  }
};
long long ketas(long long a) {
  string b = to_string(a);
  long long c = 0;
  for (long long i = 0; i < keta(a); i++) {
    c += b[i] - '0';
  }
  return c;
}
bool fe(long long a, long long b) {
  a %= 10;
  b %= 10;
  if (a == 0) a = 10;
  if (b == 0) b = 10;
  if (a > b)
    return true;
  else
    return false;
}
long long INF = 1000000007;
struct edge {
  long long s, t, d;
};
vector<long long> mojisyu(string a) {
  vector<long long> b(26, 0);
  for (long long i = 0; i < a.size(); i++) {
    b[a[i] - 'a']++;
  }
  return b;
}
long long wa2(long long a) {
  if (a % 2 == 1) return a / 2;
  return a / 2 - 1;
}
long long nCr(long long n, long long r) {
  long long a = 1;
  r = min(r, n - r);
  for (long long i = n; i > n - r; i--) {
    a *= i;
    a /= n - i + 1;
  }
  return a;
}
long long kaijou(long long a) {
  long long b = 1;
  for (long long i = 0; i < a; i++) b *= i + 1;
  return b;
}
long long nPr(long long a, long long b) {
  if (a < b) return 0;
  if (b == 0) return 1;
  long long c = 1;
  for (long long i = a; i > a - b; i--) {
    c *= i;
    c %= INF;
  }
  return c;
}
long long modpow(long long a, long long n, long long mod) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
long long modinv(long long a, long long mod) { return modpow(a, mod - 2, mod); }
long long lcm(long long a, long long b) { return a / gcm(a, b) * b; }
long long MOD = INF;
long long fac[1000010], finv[1000010], inv[1000010];
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (long long i = 2; i < 1000010; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}
long long COM(long long n, long long k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
bool naka(long long a, long long b, vector<vector<char>> c) {
  return (a >= 0 && b >= 0 && a < c.size() && b < c[0].size());
}
vector<pair<long long, long long>> mawari8 = {
    {0, -1}, {0, 1}, {1, 0}, {-1, 0}, {-1, -1}, {1, 1}, {1, -1}, {-1, -1}};
long long inf = 1000000000000000007;
vector<pair<long long, long long>> mawari4 = {{0, -1}, {0, 1}, {1, 0}, {-1, 0}};
vector<long long> onajibubun(string a) {
  vector<long long> b(a.size());
  for (long long i = 1, j = 0; i < a.size(); i++) {
    if (i + b[i - j] < j + b[j])
      b[i] = b[i - j];
    else {
      long long c = max<long long>(0, j + b[j] - i);
      while (i + c < a.size() && a[c] == a[i + c]) c++;
      b[i] = c;
      j = i;
    }
  }
  b[0] = a.size();
  return b;
}
vector<long long> color(200005);
bool nibu_hantei(long long a, long long b, vector<vector<long long>> c) {
  color[a] = b;
  for (long long i = 0; i < c[a].size(); i++) {
    if (b == color[c[a][i]]) return false;
    if (color[c[a][i]] == 0 && !nibu_hantei(c[a][i], -b, c)) return false;
  }
  return true;
}
bool renketujanai_nibu_hantei(long long a, vector<vector<long long>> c) {
  for (long long i = 0; i < a; i++) {
    if (color[i] == 0) {
      if (!nibu_hantei(i, 1, c)) return false;
    }
  }
  return true;
}
struct segadd {
  vector<long long> seg;
  long long b;
  segadd(vector<long long> a) {
    b = 1;
    while (b < a.size()) b *= 2;
    seg = vector<long long>(2 * b - 1, 0);
    for (long long i = 0; i < a.size(); i++) {
      seg[i + b - 1] = a[i];
    }
    for (long long i = b - 2; i >= 0; i--) {
      seg[i] = seg[2 * i + 1] + seg[2 * i + 2];
    }
  }
  void update(long long i, long long a) {
    i += b - 1;
    seg[i] = a;
    while (i) {
      i = (i - 1) / 2;
      seg[i] = seg[2 * i + 1] + seg[2 * i + 2];
    }
  }
  long long getadd(long long x, long long y, long long a, long long l,
                   long long r) {
    if (r == INF) r = b;
    if (r <= x || y <= l) return 0;
    if (x <= l && r <= y) return seg[a];
    long long a1 = getadd(x, y, 2 * a + 1, l, (l + r) / 2);
    long long a2 = getadd(x, y, 2 * a + 2, (l + r) / 2, r);
    return a1 + a2;
  }
};
struct sege {
  vector<pair<long long, vector<long long>>> seg;
  long long b;
  sege(string a) {
    b = 1;
    while (b < a.size()) b *= 2;
    seg = vector<pair<long long, vector<long long>>>(2 * b - 1);
    for (long long i = 0; i < a.size(); i++) {
      seg[i + b - 1].first = 1;
      seg[i + b - 1].second.push_back(a[i] - 'a');
    }
    for (long long i = b - 2; i >= 0; i--) {
      vector<long long> d = seg[2 * i + 1].second;
      for (long long j = 0; j < seg[2 * i + 2].second.size(); j++) {
        d.push_back(seg[2 * i + 2].second[j]);
      }
      sort(d.begin(), d.end());
      d.erase(unique(d.begin(), d.end()), d.end());
      seg[i].second = d;
      seg[i].first = d.size();
    }
  }
  vector<long long> mu;
  void update(long long i, char a) {
    i += b - 1;
    seg[i].second = mu;
    seg[i].second.push_back(a - 'a');
    seg[i].first = 1;
    while (i) {
      i = (i - 1) / 2;
      vector<long long> d = seg[2 * i + 1].second;
      for (long long j = 0; j < seg[2 * i + 2].second.size(); j++) {
        d.push_back(seg[2 * i + 2].second[j]);
      }
      sort(d.begin(), d.end());
      d.erase(unique(d.begin(), d.end()), d.end());
      seg[i].second = d;
      seg[i].first = d.size();
    }
  }
  void unko() {
    for (long long i = 0; i < 2 * b - 1; i++) cout << seg[i].first << ' ';
  }
  pair<long long, vector<long long>> gete(long long x, long long y, long long a,
                                          long long l, long long r) {
    if (r == INF) r = b;
    if (r <= x || y <= l) return {0, mu};
    if (x <= l && r <= y) return seg[a];
    pair<long long, vector<long long>> a1 =
        gete(x, y, 2 * a + 1, l, (l + r) / 2);
    pair<long long, vector<long long>> a2 =
        gete(x, y, 2 * a + 2, (l + r) / 2, r);
    for (long long i = 0; i < a2.second.size(); i++)
      a1.second.push_back(a2.second[i]);
    sort(a1.second.begin(), a1.second.end());
    a1.second.erase(unique(a1.second.begin(), a1.second.end()),
                    a1.second.end());
    return {a1.second.size(), a1.second};
  }
};
long long kurikaesijijou(long long a, long long b, long long c) {
  a %= c;
  if (b == 0) return 1;
  if (b % 2 == 0) {
    long long d = kurikaesijijou(a, b / 2, c);
    d %= c;
    return d * d % c;
  }
  return a * kurikaesijijou(a, b - 1, c) % c;
}
long long waINF(long long a) {
  if (a >= 0) return a % INF;
  return (a + INF * INF) % INF;
}
bool find_negative_roop(vector<pair<pair<long long, long long>, long long>> a,
                        vector<long long> b) {
  vector<long long> d(b.size(), 1), e;
  for (long long i = 0; i < 3 * b.size(); i++) {
    for (long long j = 0; j < a.size(); j++) {
      pair<pair<long long, long long>, long long> c = a[j];
      if (b[c.first.first] != inf &&
          b[c.first.second] > b[c.first.first] + c.second) {
        b[c.first.second] = b[c.first.first] + c.second;
        if (i >= b.size() - 1 && d[c.first.first]) {
          d[c.first.first] = 0;
          e.push_back(c.first.first);
        }
        if (i >= b.size() - 1 && d[c.first.second]) {
          d[c.first.second] = 0;
          e.push_back(c.first.second);
        }
      }
    }
  }
  if (e.size() == 0) return 0;
  Union f(b.size());
  for (long long i = 0; i < e.size() - 1; i++) {
    f.unite(e[i], e[i + 1]);
  }
  for (long long j = 0; j < b.size(); j++) {
    for (long long i = 0; i < a.size(); i++) {
      if (f.same(a[i].first.first, e[0])) {
        f.unite(e[0], a[i].first.second);
      }
    }
  }
  if (f.same(e[0], b.size() - 1)) return 1;
  return 0;
}
void tyokkei_init(long long a, long long b, long long c, long long &d,
                  long long &e, vector<vector<long long>> &f) {
  if (c > d) {
    d = c;
    e = b;
  }
  for (long long i = 0; i < f[b].size(); i++) {
    if (f[b][i] == a) continue;
    tyokkei_init(b, f[b][i], c + 1, d, e, f);
  }
}
long long kinotyokkei(vector<vector<long long>> &a) {
  long long b = 0, c = 0, d = 0;
  tyokkei_init(-1, b, 0, d, c, a);
  b = c, c = 0, d = 0;
  tyokkei_init(-1, b, 0, d, c, a);
  return d;
}
long long tree_kyori(long long a, long long b, vector<vector<long long>> &c) {
  if (a == b) return 0;
  queue<long long> e;
  e.push(a);
  vector<long long> d(c.size(), inf);
  d[a] = 0;
  while (!d.empty()) {
    long long f = e.front();
    e.pop();
    for (long long i = 0; i < c[f].size(); i++) {
      if (d[c[f][i]] == inf) {
        d[c[f][i]] = d[f] + 1;
        if (c[f][i] == b) return d[c[f][i]];
        e.push(c[f][i]);
      }
    }
  }
  return 0;
}
pair<vector<long long>, bool> topological_sort(vector<long long> &a,
                                               vector<vector<long long>> &b) {
  stack<long long> c;
  for (long long i = 0; i < a.size(); i++) {
    if (a[i] == 0) c.push(i);
  }
  bool d = 0;
  vector<long long> e;
  while (!c.empty()) {
    if (c.size() > 1) d = 1;
    long long f = c.top();
    c.pop();
    e.push_back(f);
    for (long long i = 0; i < b[f].size(); i++) {
      a[b[f][i]]--;
      if (a[b[f][i]] == 0) c.push(b[f][i]);
    }
  }
  return {e, d};
}
struct segmin {
  vector<long long> seg;
  long long b;
  segmin(vector<long long> a) {
    b = 1;
    while (b < a.size()) b *= 2;
    seg = vector<long long>(2 * b - 1, inf);
    for (long long i = 0; i < a.size(); i++) {
      seg[i + b - 1] = a[i];
    }
    for (long long i = b - 2; i >= 0; i--) {
      seg[i] = min(seg[2 * i + 1], seg[2 * i + 2]);
    }
  }
  void update(long long i, long long a) {
    i += b - 1;
    seg[i] = a;
    while (i) {
      i = (i - 1) / 2;
      seg[i] = min(seg[2 * i + 1], seg[2 * i + 2]);
    }
  }
  long long getmin(long long x, long long y, long long a, long long l,
                   long long r) {
    if (r == INF) r = b;
    if (r <= x || y <= l) return INF;
    if (x <= l && r <= y) return seg[a];
    long long a1 = getmin(x, y, 2 * a + 1, l, (l + r) / 2);
    long long a2 = getmin(x, y, 2 * a + 2, (l + r) / 2, r);
    return min(a1, a2);
  }
};
template <typename X, typename FX>
struct SegTree {
  long long n = 1;
  FX fx;
  X ex;
  vector<X> seg;
  SegTree(vector<X> a, FX b, X c) : fx(b), ex(c) {
    while (a.size() > n) {
      n *= 2;
    }
    seg = vector<X>(2 * n - 1, c);
    for (long long i = 0; i < a.size(); i++) {
      seg[n - 1 + i] = a[i];
    }
    for (long long i = n - 2; i >= 0; i--) {
      seg[i] = fx(seg[2 * i + 1], seg[2 * i + 2]);
    }
  }
  void update(long long i, X x) {
    i += n - 1;
    seg[i] = x;
    while (i) {
      i = (i - 1) / 2;
      seg[i] = fx(seg[i * 2 + 1], seg[i * 2 + 2]);
    }
  }
  X query(long long a, long long b) { return query_sub(a, b, 0, 0, n); }
  X query_sub(long long a, long long b, long long i, long long l, long long r) {
    if (r <= a || b <= l)
      return ex;
    else if (a <= l && r <= b)
      return seg[i];
    else {
      X l1 = query_sub(a, b, i * 2 + 1, l, (l + r) / 2);
      X r1 = query_sub(a, b, i * 2 + 2, (l + r) / 2, r);
      return fx(l1, r1);
    }
  }
};
signed main() {
  long long a, b;
  cin >> a >> b;
  vector<long long> c(a);
  for (long long i = 0; i < a; i++) cin >> c[i];
  long long d = c[0], e = 0;
  for (long long i = 0; i < a; i++) {
    if (abs(d - c[i]) <= b) {
      e++;
      d = c[i];
    }
  }
  cout << e << endl;
}
