n,k = map(int, input().split())
b = []
c = []
d = []
for i in range(n):
  a = int(input())
  c.append(a)
  if i >=1:
    if abs(a-b[-1])>k:
      d.append(i)
      continue
  b.append(a)
e = [c[d[0]]]
for i in range(n):
  if abs(c[i]-e[-1])>k:
    continue
  e.append(c[i])
print(max(len(e)-1,len(b)))