from bisect import bisect_left N,Q = map(int,input().split()) A = list(map(int,input().split())) B = [] for i in range(N): B += list(range(1,A[i]+1)) C = [0]*len(B) C[0] = B[0] for i in range(1,len(B)): C[i] = C[i-1]+B[i] for _ in range(Q): s = int(input()) ind = bisect_left(C,s) if ind==len(B): print(-1) else: print(ind+1)