N,K=map(int,input().split())

alist=[]
for _ in range(N):
  a=int(input())
  alist.append(a)
#print(alist)

now=alist[0]
seq_list=[0]
for i in range(1,N):
  if abs(alist[i]-now)<=K:
    now=alist[i]
    seq_list.append(i)
#print(seq_list)
print(len(seq_list))