n,k=map(int,input().split())
a=list()
b=list()
c=list()
for i in range(0,n):
    q=int(input())
    a.append(q)

b.append(a[0])
c.append(a[1])

for i in range(1,n):
    c=a[i]-a[i-1]
    c=abs(c)
    #print(c)
    if(c<=k):
        b.append(a[i])
    

for i in range(2,n):
    c=a[i]-a[i-1]
    c=abs(c)
    #print(c)
    if(c<=k):
        c.append(a[i])        
if(len(b)>len(c)):
    print(len(b))
else:
    print(len(c)) 