import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.readline()) def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def SI(): return sys.stdin.readline()[:-1] def main(): n=II() l=II() xx=[0]+[II() for _ in range(n-1)] xx.reverse() s=0 ans=n-1 for i in range(n): if i: if abs(pre-xx[i])>=l: print(-1) exit() if (2*xx[i]-l)*i<2*s<(2*xx[i]+l)*i and (2*xx[i-1]-l)*i<2*s<(2*xx[i-1]+l)*i:ans-=1 pre=xx[i] s+=xx[i] print(ans) main()