N, K = map(int,input().split())
a = int(input())
Alist = [a]
for i in range(N-1):
    anext = int(input())
    if abs(anext-a) <= K:
        Alist.append(anext)
        a = anext
    else:
        continue
print(len(Alist))