n, k =map(int,input().split())
a=[]
ans = 0
cnt = 1
for i in range(n):
    a.append(int(input()))

b = a[0]
for j in range(1,n):
    if abs(b-a[j]) <= k:
        b = a[j]
        cnt += 1
else:
    ans=max(ans,cnt)


print(ans)
