#import resource
#import sys
#resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])
#sys.setrecursionlimit(0x10000000)
from sys import stdin, stdout
def modinv(n,p):
    return pow(n,p-2,p)
def ncr(n,r,p,f):
    t=((f[n])*(modinv(f[r],p)%p)*(modinv(f[n-r],p)%p))%p
    return t
def GCD(x, y):
   while(y):
       x, y = y, x % y
   return x
def BS(arr, l, r, x):
    if r >= l:
        mid = l + (r - l)/2
        if arr[mid] == x:
            return mid
        elif arr[mid] > x:
            return BS(arr, l, mid-1, x)
        else:
            return BS(arr, mid+1, r, x)
    else:
        return -1
mod=(10**9)+7
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
import math
from Queue import Queue as Q
import heapq
"""---------------------------------------------------------------------"""
n,q=map(int,raw_input().split())
b=map(int,raw_input().split())
t=[0]*50
for i in range(n):
    r=int(math.log(b[i],2))
    t[r]+=1
b.sort()
print t
while(q>0):
    q-=1
    a=input()
    s=0
    h=n
    while(a>0):
        g=br(b,a,0,h)
        if(g==0):
            s=-1
            break
        else:
            r=int(math.log(b[g-1],2))
            w=min(a/b[g-1],t[r])
            a-=(b[g-1]*w)
            h=g-1-t[r]
            s+=1
    print s
