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

t = [[AS[0]]]

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

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