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 java.io.*;
import java.util.*;

public class Main {

	static class PairComparator implements Comparator<Pair> {
		@Override
		public int compare(Pair x, Pair y) {
			if (x.val < y.val)
				return -1;
			if (x.val > y.val)
				return 1;
			if (x.val == y.val) {
				if (x.ind < y.ind)
					return -1;
				if (x.ind > y.ind)
					return 1;
			}
			return 0;
		}
	}

	static class Pair {
		int ind, val;

		Pair(int i, int v) {
			ind = i;
			val = v;
		}
	}

	static int[] vis;

	static long sum=0;
	static boolean dfs(int curr, List<Integer >[] tree, int minV, int[] p){
		if (p[curr]==-1){
			int minCurr = Integer.MAX_VALUE;
			for (int i=0;i<tree[curr].size();i++){
				minCurr = Math.min(minCurr, p[tree[curr].get(i)]);	
			}
			p[curr] = minCurr;
		}
		if (p[curr]<minV)return false;
		if (p[curr]!=Integer.MAX_VALUE)sum+=p[curr] - minV;
		for (int i=0;i<tree[curr].size();i++){

			if (!dfs(tree[curr].get(i), tree, p[curr]==-1?minV:p[curr], p)){
				return false;
			}	
		}
		return true;

	}

	static void func() throws Exception {
		int n , q;
		n = sc.nextInt();
		q = sc.nextInt();
		int[] arr = new int[33];
		for (int i=0;i<n;i++){
			int v = sc.nextInt();
			int cnt=0;
			while (v!=1){
				v/=2;
				cnt++;
			}
			arr[cnt]++;
		}
		for (int i=0;i<q;i++){
			int val = sc.nextInt();
			long curr = 1;
			for (int j=0;j<30;j++){
				curr*=2;
			}
			int coins = 0;
			for (int j=30;j>=0;j--){
				if (curr<=val && arr[j]>0){
					long use = Math.min(val/curr, arr[j] );
					coins+=use;
					val -= use*curr;
				}
				curr/=2;
				if (val==0)break;
			}
			if (val>0)pw.println(-1);
			else pw.println(coins);

			pw.flush();
		}
		
		
	}

	/*
	 
	 * */
	static PrintWriter pw;
	static MScanner sc;

	public static void main(String[] args) throws Exception {

		pw = new PrintWriter(System.out);
		sc = new MScanner(System.in);

		int tests = 1;
	//	tests =sc.nextInt(); //comment this line
		while (tests-- > 0) {
			func();
			pw.flush();
		}

	}

	static class MScanner {
		StringTokenizer st;
		BufferedReader br;

		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int[] intArr(int n) throws IOException {
			int[] in = new int[n];
			for (int i = 0; i < n; i++)
				in[i] = nextInt();
			return in;
		}

		public long[] longArr(int n) throws IOException {
			long[] in = new long[n];
			for (int i = 0; i < n; i++)
				in[i] = nextLong();
			return in;
		}

		public int[] intSortedArr(int n) throws IOException {
			int[] in = new int[n];
			for (int i = 0; i < n; i++)
				in[i] = nextInt();
			shuffle(in);
			Arrays.sort(in);
			return in;
		}

		public long[] longSortedArr(int n) throws IOException {
			long[] in = new long[n];
			for (int i = 0; i < n; i++)
				in[i] = nextLong();
			shuffle(in);
			Arrays.sort(in);
			return in;
		}

		public Integer[] IntegerArr(int n) throws IOException {
			Integer[] in = new Integer[n];
			for (int i = 0; i < n; i++)
				in[i] = nextInt();
			return in;
		}

		public Long[] LongArr(int n) throws IOException {
			Long[] in = new Long[n];
			for (int i = 0; i < n; i++)
				in[i] = nextLong();
			return in;
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}

	static void shuffle(int[] in) {
		for (int i = 0; i < in.length; i++) {
			int idx = (int) (Math.random() * (i + 1));
			int tmp = in[i];
			in[i] = in[idx];
			in[idx] = tmp;
		}
	}

	static void shuffle(long[] in) {
		for (int i = 0; i < in.length; i++) {
			int idx = (int) (Math.random() * (i + 1));
			long tmp = in[i];
			in[i] = in[idx];
			in[idx] = tmp;
		}
	}
}
