n, k = map(int,input().split())
ans = 0
c = int(input())
a = int(input())
if abs(c-a) <= k:
  
  ans +=1
for i in range(n-2):
  b = int(input())
  if abs(a-b) <= k:
    ans += 1
  a = b
  
print(ans+1)
