import java.io.*;
import java.util.*;
public class D {
	BufferedReader in;
	PrintWriter ob;
	StringTokenizer st;
	public static void main(String args[]) throws IOException {
		new D().run();
	}
	void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		ob = new PrintWriter(System.out);
		solve();
		ob.flush();
	}
	void solve() throws IOException {
		int n = ni() , q = ni();
		int a[] = new int[n];
		int f[] = new int[32];
		for(int i=0 ; i<n ; i++) {
			f[Integer.numberOfTrailingZeros(ni())]++; 
		}
		while(q-->0) {
			int x = ni();
			int ret = 0;
			for(int d = 31 ; d>=0 ; d--) {
				int bit = x>>d;
				int use = Math.min(bit , f[d]);
				x-=(use*((int)Math.pow( 2 , d )));
				ret+=use;
			}
			if(x!=0)
				ob.println("-1");
			else
				ob.println(ret);
		}
		
	}
	int ni() throws IOException {
		return Integer.parseInt(nextToken());
	}
	String nextToken() throws IOException {
		if(st==null || !st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
}
