from collections import deque
N, K = [int(i) for i in input().split()]
AS = [int(input()) for _ in range(N)]

t = deque([(1, AS[0])])

for i in range(1, N):
  cnt, lst = t[i-1]
  if abs(lst - AS[i]) <= K:
    t.append((cnt + 1, AS[i]))
  else:
    t.append((cnt, lst))

print(t[N-1][0])
