"""
________        _____________              ______
___  __ \____  ____  __ \__(_)__   _______ ___  /
__  /_/ /_  / / /_  /_/ /_  /__ | / /  __ `/_  /
_  ____/_  /_/ /_  _, _/_  / __ |/ // /_/ /_  /
/_/     _\__, / /_/ |_| /_/  _____/ \__,_/ /_/
        /____/

https://github.com/Cheran-Senthil/PyRival
Copyright (c) 2018 Cheran Senthilkumar
"""
from __future__ import division, print_function

import cmath
import itertools
import math
import operator as op
import sys
from atexit import register
from bisect import bisect_left, bisect_right

# import random
# from collections import Counter, MutableSequence, defaultdict, deque
# from copy import deepcopy
# from decimal import Decimal
# from difflib import SequenceMatcher
# from heapq import heappop, heappush

if sys.version_info[0] < 3:
    from io import BytesIO as stream
    # from fractions import Fraction
    # from fractions import gcd
    # from cPickle import dumps
    # from Queue import PriorityQueue, Queue
else:
    from io import StringIO as stream
    # from functools import reduce
    # from fractions import Fraction
    # from math import gcd
    # from pickle import dumps
    # from queue import PriorityQueue, Queue


if sys.version_info[0] < 3:
    class dict(dict):
        def items(self):
            return dict.iteritems(self)

        def keys(self):
            return dict.iterkeys(self)

        def values(self):
            return dict.itervalues(self)

    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip


def sync_with_stdio(sync=True):
    """
    Sets whether the standard Python streams are allowed to buffer their I/O.

    Parameters
    ----------
    sync : bool, optional
        The new synchronization setting. Default is True.
    """
    global input, flush

    if sync:
        flush = sys.stdout.flush
    else:
        sys.stdin = stream(sys.stdin.read())
        input = lambda: sys.stdin.readline().rstrip('\r\n')

        sys.stdout = stream()
        register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))


def main():
    n, q = map(int, input().split(' '))
    a = sorted((map(int, input().split(' '))))
    partial_sums = [0]
    for i in a:
        partial_sums.append(partial_sums[-1] + i)

    memo = {}
    for _ in range(q):
        b = int(input())
        try:
            print(memo[b])
        except:
            all_b = [b]
            while b != 0:
                start = bisect_right(a, b) - 1
                if (start == -1) or (partial_sums[start + 1] < b):
                    for i in all_b:
                        memo[i] = -1
                    break
                while a[start] <= b:
                    b -= a[start]
                    all_b.append(b)
                    start -= 1
                    if start == -1:
                        for i in all_b:
                            memo[i] = -1
                        break
            if b == 0:
                for i, x in enumerate(all_b):
                    memo[x] = len(all_b) - i - 1
            print(memo[all_b[0]])


if __name__ == '__main__':
    sys.setrecursionlimit(10000)
    sync_with_stdio(False)
    main()
