N,K = map(int, input().split())
a_list = []
for i in range(N):
    a_list.append(int(input()))

b = a_list[0]
ans = []
ans.append(a_list[0])
for i in a_list:
    if abs(i - b) <= K:
        ans.append(i)
        b = i

print(len(ans) - 1)
    