N, K = map(int, input().split())
list = [int(input()) for _ in range(N)]


new_list = []
new_list.append(list[0])

for i in range(N):
    if i + 1 == N:
        break
  
    did = abs(new_list[-1] - list[i + 1])
   
    if did <= K:
        new_list.append(list[i + 1])
        
if len(new_list) == 1:
    new_list.remove(new_list[0])
        
print(len(new_list))