n, k = map(int, input().split())

a = []
for _ in range(n):
    a.append(int(input()))
b = a[0]
ans = 1
flag = False
for i in range(1, n):
    if abs(a[i] - b) <= k:
        ans += 1
        b = a[i]
        flag = True
    elif not flag:
        b = a[i]
print(ans)
