n,k = map(int,input().split())
ans = 1
a1 = int(input())
bi = a1
for i in range(n-1):
    ai = int(input())
    if abs(a1 - ai) <= k and abs(bi - ai) <= k:
        ans += 1
        bi = ai
    a1 = ai
print(ans)