import sys import math def is_invalid(L: int, xs: list[int]) -> bool: for i in range(len(xs) - 1): if abs(xs[i] - xs[i + 1]) >= L: return True return False def calc(N: int, L: int, xs: list[int]) -> int: if is_invalid(L, xs): return -1 ans = 0 p = (xs[-1] + xs[-1] + L) / 2.0 cnt = 1 for i in range(len(xs) - 2, -1, -1): t = p / cnt if (xs[i] < t < xs[i] + L) and (xs[i + 1] < t < xs[i + 1] + L): pass else: ans += 1 p += (xs[i] + xs[i] + L) / 2.0 cnt += 1 return ans N = int(input()) L = int(input()) xs = [0] for _ in range(N-1): xs.append(int(input())) ans = calc(N, L, xs) print(ans)