n,k = map(int, input().split())
anslist = [] 

for i in range(n):
  num = int(input())
  
  if i == 0:
    anslist.append(num)
  else:
    if abs(anslist[len(anslist)-1] - num) <= k:
      anslist.append(num)
print(len(anslist))