#include<bits/stdc++.h>
#include <atcoder/all>
/* #define int long long */
/* #define double long double */
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define repa(i, s, n) for(int i = s; i < (int)n; i++)
#define MOD 1000000007
using namespace std;
using namespace atcoder;
using ll = long long;
typedef vector<int> vi;
typedef pair<int, int> P;
#define rrep(i,a,b) for(int i=a;i>=b;i--)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
/* g++ a.cpp -std=c++14 -I ../ */

signed main(){
    int n, k;
    cin >> n >> k;
    vi a(n);
    rep(i, n) cin >> a[i];
    /* cout << "-------------------" << endl; */
    int ans = 0;
    rep(i, n-1){
        /* cout << abs(a[i] - a[i+1]) << endl; */
        if(abs(a[i] - a[i+1]) <= k) ans++;
    }
    cout << ans+1 << endl;
}