import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
from collections import deque, defaultdict, Counter
import heapq

def main():
    N, K = MI()
    B = []
    for i in range(N):
        a = I()
        if i == 0:
            now = a
            B.append(now)
        else:
            if abs(a - now) <= K:
                B.append(a)
                now = a
    print(len(B))
if __name__ == "__main__":
    main()

