n,k = map(int, input().split())

A = [0]*n
cnt = 1

A[0] = int(input())
for i in range(1,n):
  A[i] = int(input())
  if abs(A[i-1] - A[i])<=k:
    #print(A[i-1],A[i])
    cnt+=1
  else:
    A[i]=A[i-1]
    
print(cnt)
  