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