import sys
input=sys.stdin.readline

n,k=map(int,input().split())
a=[]
b=[]
for i in range(n):

  t=int(input())
  if i==0:
    b.append(t)
  else:
    if abs(b[-1]-t)<=k:
      b.append(t)
print(len(b))