n, k = map(int, input().split())
a = []
dp = [0 for _ in range(n + 1)]
dp[0] = 1
for i in range(n):
    _ = int(input())
    a.append(_)
for i in range(n - 1):
    if abs(a[i] - a[i + 1]) <= k:
        dp[i + 1] = dp[i] + 1
    else:
        dp[i + 1] = dp[i]
print(dp[n - 1])