from bisect import bisect
n,q=map(int,input().split())
a=list(map(int,input().split()))
a=sorted(a,reverse=True)
pref = [0]
for i in a:
    pref += [pref[-1]+i]
print(pref)
for i in range(q):
    b=int(input())
    ans = 0
    pos = bisect(pref,b)-1
    ans += pos
    b -= pref[pos]
    for p in a[pos:]:
        if b <= 0:
            break
        if p <= b:
            b -= p
            ans += 1
    print(-1 if b > 0 else ans)