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

l = 0
r = 1
while l < n:
    if l == r and r < n:
        r += 1
    if l == n-1:
        if abs(a[l]-b[-1]) <= k:
            b.append(a[l])
            break          
    if len(b) == 0:
        if abs(a[r]-a[l]) <= k:
            b.append(a[l])
            l = r
            continue
        r += 1
    else:
        if abs(a[l]-b[-1]) <= k and abs(a[r]-a[l]) <= k:
            b.append(a[l])
            l = r
            continue
        r += 1


print(len(b))








