n, q = map(int, input().split())
a=[]
a = [int(x) for x in input().split()]
s=0

while q>0:
    ct=0
    b=int(input())
    if b%2 != 0:
        print(-1)
    elif b in a:
        print(1)
    elif b<min(a):
        print(-1)
    elif b>sum(a):
        print(-1)
    else:
        a.sort(reverse=True)
        for i in a:
            if b>s+i:
                ct+=1
                s = s+i
                
        print(ct)

    q-=1
