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

check = 0
b = []
b += [a[0]]
for num in range(len(a)-1):
    if abs(a[num] - a[num+1])  <= k:
      b += [a[num+1]]

print(len(b))