from collections import Counter
coins,query=(map(int, input (). split ()))
val= list(map(int, input (). split ()))
val.sort()
for i in range(query):
    a=input()
    a=int(a)
    if a%2!=0:
        print('-1')
    elif a in val:
        print('1')
    elif a>sum(val):
        print('-1')
    else:
        c=0
        k=len(val)-1
        while k>=0 and a>=0:
            if a>=val[k]:
                a=a-val[k]
                k=k-1
                c+=1
                print(c)
            else:
                k=k-1
        if a==0:
            print(c)
        else:
            print('-1')
        
        
