A= input().split()
N = int(A[0])
K = int(A[1])
B = list()
C = int(input())
B.append(C)
if A!=1:
  for i in range(N-1):
    D = int(input())
    if abs(C-D)<=K:
      C = D
      B.append(D)
print(len(B))