N,K = map(int,input().split())
A = [int(input()) for _ in range(N)]
DP = [1] + [0] * (N-1)

for i in range(1,len(A)):
  if abs(A[i-1]-A[i]) <= K:
    DP[i] += DP[i-1] + 1
  else:
    DP[i] = DP[i-1]

print(DP[N-1])

