N,K = map(int, input().split())
A = []
for _ in range(N):
    A.append(int(input())) 
ans = 1
X = 0
for i in range(X,N-1):
  if A[i]-A[i+1] >= -K and A[i]-A[i+1] <= K:
    X = i
    ans += 1
print(ans)