import sys
input = sys.stdin.readline
from collections import Counter

n, q = map(int, input().split())
a = list(map(int, input().split()))
cnt = Counter(a)
k = list(cnt.keys())
k.sort(reverse=True)

for _ in range(q):
    b = int(input())
    ans = 0
    
    for ki in k:
        c = min(b//ki, cnt[ki])
        ans += c
        b -= c*ki
    
    if b>0:
        print(-1)
    else:
        print(ans)