import bisect N,Q=map(int,input().split()) A=list(map(int,input().split())) P=[] for a in A: P+=list(range(1,a+1)) S=[0] for p in P: S.append(S[-1]+p) for i in range(Q): x=int(input()) k=bisect.bisect_left(S,x) if k==len(S): print(-1) else: print(k)