from collections import Counter

getListInput = lambda: list(map(int, input().split()))

NC, NQ = getListInput()
CS = getListInput()

COUNTER = sorted(Counter(CS).items(), reverse=True)

ANSWER = []
for _ in range(NQ):
    QT = int(input())
    
    MIN = 0
    for k, v in COUNTER:
        coins = min(QT//k, v)
        MIN += coins
        QT -= coins*k

    ANSWER.append(MIN if QT == 0 else -1)
    
print(" ".join(map(str, ANSWER)))


