import sys

if __name__ == '__main__':
    params = sys.stdin.readline().strip('\n').split(' ')
    n = int(params[0])
    q = int(params[1])

    coins = sys.stdin.readline().strip('\n').split(' ')
    coins.sort(reverse=True)

    pow_dict = {}
    for num in coins:
        if num not in pow_dict:
            pow_dict[int(num)] = 1
        else:
            pow_dict[int(num)] += 1

    for t in range(0, q):
        q = int(sys.stdin.readline())

        if q % 2 != 0:
            print(-1)
            continue

        curr_coins = 0
        for key, value in pow_dict.items():
            if key <= q and q > 0:
                curr_coins += min(q // key, value)
                q -= key * min(q // key, value)
            if q == 0:
                break

        if q != 0:
            print(-1)
        else:
            print(curr_coins)