n,q=map(int,input().split()) A=list(map(int,input().split())) B=[0]*101010 p = 0; for i in range(N): n = A[i] for j in range(n): B[p] = j+1 p += 1 S = [0 for i in range(p+2)] for i in range(p): S[i+1] = S[i]+B[i] for i in range(q): s=int(input()) ng=-1 ok=p+1 while abs(ok-ng)>1: mid=(ok+ng)//2 if S[mid]>=s: ok=mid else: ng=mid if ok==p+1: print(-1) else: print(ok) exit()