Polycarp has n coins, the value of the i-th coin is a_i. It is guaranteed that all the values are integer powers of 2 (i.e. a_i = 2^d for some non-negative integer number d).

Polycarp wants to know answers on q queries. The j-th query is described as integer number b_j. The answer to the query is the minimum number of coins that is necessary to obtain the value b_j using some subset of coins (Polycarp can use only coins he has). If Polycarp can't obtain the value b_j, the answer to the j-th query is -1.

The queries are independent (the answer on the query doesn't affect Polycarp's coins).

Input

The first line of the input contains two integers n and q (1 ≤ n, q ≤ 2 ⋅ 10^5) — the number of coins and the number of queries.

The second line of the input contains n integers a_1, a_2, ..., a_n — values of coins (1 ≤ a_i ≤ 2 ⋅ 10^9). It is guaranteed that all a_i are integer powers of 2 (i.e. a_i = 2^d for some non-negative integer number d).

The next q lines contain one integer each. The j-th line contains one integer b_j — the value of the j-th query (1 ≤ b_j ≤ 10^9).

Output

Print q integers ans_j. The j-th integer must be equal to the answer on the j-th query. If Polycarp can't obtain the value b_j the answer to the j-th query is -1.

Example

Input

5 4
2 4 8 2 4
8
5
14
10


Output

1
-1
3
2
#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")
