n,k,*L = map(int,open(0).read().split())
#print(L)
dp = [0] * n
dp[0] = 1

for i in range(n-1):
    if -k <=(L[i+1]-L[i]) <= k:
        dp[i+1] = dp[i] +1
    else:
        dp[i+1] = dp[i]
    #print(L,dp)
print(dp[n-1])