from sys import stdin, stdout
from bisect import bisect_right as br

n, q = map(int, raw_input().split())
coins = map(int, raw_input().split())
coins.sort()
s = sum(coins)

try:
    p = 1
    while p < s: p <<= 1
    if p > s: p >>= 1

    d = {}

    while p >= 1:
        if p > s:
            d[p] = 0
            p >>= 1
        else:
            ind = br(coins, p)
            if ind == 0 and coins[0] != p:
                d[p] = 0
                p >>= 1
            else:
                req = 0
                b = p
                while ind > 0:
                    b -= coins[ind - 1]
                    req += 1
                    ind = br(coins, b, 0, ind - 1)
                d[p] = req
                p >>= 1
except:
    print "Gotcha!"
            
inp = stdin.readlines()
out = []
for line in inp:
    b = int(line.strip())
    pos = 1
    ans = 0
    while b > 0:
        if b & 1:
            if pos not in d:
                ans = -1
                break
            elif d[pos] == 0:
                ans = -1
                break
            else:
                ans += d[pos]
        pos <<= 1
        b >>= 1

    out.append(str(ans))
            
stdout.write('\n'.join(out))
