import java.io.*;
import java.util.*;
import static java.lang.Math.*;

public class D{
	public static void main(String[] args) throws IOException {
		// br = new BufferedReader(new FileReader(".in"));
		// out = new PrintWriter(new FileWriter(".out"));
		//new Thread(null, new (), "peepee", 1<<28).start();
		
		int n =readInt(), q =readInt();
		long[] cnt = new long[32];
		for (int i =0 ; i < n; i++) {
			int a =readInt();
			for (int j= 0 ; j < 32; j++) {
				if ((1<<j) == a) cnt[j]++;
			}
		}
		while(q-->0) {
			long x =readInt();
			int ans = 0;
			for (int i = 31; i >= 0; i--) {
				long maxCan = cnt[i] * (1<<i);
				if (maxCan >= x) {
					long sub = x/(1<<i);
					x-=sub*(1<<i);
					ans+=sub;
				}
				else {
					x -= maxCan;
					ans+=cnt[i];
				}
			}
			
			out.println(x==0?ans:-1);
		}
		
		out.close();
	}
	
	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
	static StringTokenizer st = new StringTokenizer("");
	static String read() throws IOException{return st.hasMoreTokens() ? st.nextToken():(st = new StringTokenizer(br.readLine())).nextToken();}
	static int readInt() throws IOException{return Integer.parseInt(read());}
	static long readLong() throws IOException{return Long.parseLong(read());}
	static double readDouble() throws IOException{return Double.parseDouble(read());}
}