#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,stdin.readline().split())
b=map(int,stdin.readline().split())
t={}
for i in range(n):
    if(t.has_key(b[i])):
        t[b[i]]+=1
    else:
        t[b[i]]=1
f=[]
for i in t:
    f.append([i,t[i]])
f.sort(key=lambda x:x[0])
while(q>0):
    q-=1
    a=int(stdin.readline())
    s=0
    h=len(f)-1
    while(a!=0):
        if(h==-1):
            s=-1
            break
        else:
            if(f[h][0]<=a):
                r=min(a/f[h][0],f[h][1])
                a-=(r*f[h][0])
                s+=r
        h-=1
    stdout.write(str(s)+"\n")
