def max_length(arr,k):
    count = 1
    d = arr[0]
    for i in range(1,len(arr)):
        if abs(d-arr[i])<=k:
            d = arr[i]
            count+=1
    return count
nk = list(map(int,input().split()))
n = nk[0]
k = nk[1]
arr = []
for _ in range(n):
    arr.append(int(input()))
print(max_length(arr,k))