#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())
b.sort(reverse=True)
w=[0]*q
r=[0]*q
l=[]
for i in range(q):
    a=input()
    heapq.heappush(l,[-a,i])
print l
for i in range(n):
    t=[]
    while(len(l)>0):
        if(b[i]<=-l[0][0]):
            w[l[0][1]]+=1
            t.append(heapq.heappop(l))
            t[-1][0]+=b[i]
            if(t[-1][0]==0):
                r[t[-1][1]]=1
        else:
            break
    for i in range(len(t)):
        heapq.heappush(l,t[i])
for i in range(q):
    if(r[i]==0):
        print -1
    else:
        print w[i]
