import sys
input=sys.stdin.readline
from collections import defaultdict
n,q=list(map(int,input().split()))
a=list(map(int,input().split()))
b=defaultdict(int)
for i in range(n):
    b[a[i]]+=1
c=[]
for i in b:
    c.append([i,b[i]])
c.sort(reverse=True)
t=len(c)
for i in range(q):
    b=int(input())
    d=0
    for j in range(t):
        d+=min(b//c[j][0],c[j][1])
        b=b-c[j][0]*min(b//c[j][0],c[j][1])
    if b==0:
        print(d)
    else:print(-1)