import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args) throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] s = br.readLine().split(" ");	
		int N = Integer.parseInt(s[0]);
		int Q = Integer.parseInt(s[1]);
		int[] coin = new int[40];
		int ans = 0;
		s = br.readLine().split(" ");
		for(int i=0; i<N; i++){
			coin[log(Integer.parseInt(s[i]))]++;
		}
		for(int i=0; i<Q; i++){
			int q = Integer.parseInt(br.readLine());
			int nth = log(q);
			ans = 0;
			while(q != 0){
				if(coin[nth] == 0) nth--;
				else{
					if(q >= pow(nth) * coin[nth]){
						q -= pow(nth) * coin[nth];
					}
					else{
						for(int j=1; j<=coin[nth]; j++){
							if(q >= pow(nth)) {
								q -= pow(nth);
								ans++;
							} else break;
						}
						nth--;
					}
				}
				if(nth == -1) break;
			}
			if(q != 0) System.out.println(-1);
			else System.out.println(ans);
		}
		
	}
	public static int pow(int n){
		int ret = 1;
		for(int i=0; i<n; i++){
			ret *= 2;
		}
		return ret;
	}
	public static int log(int n){
		int cnt = 0;
		while(true){
			if(n == 1) break;
			n /= 2;
			cnt++;
		}
		return cnt;
	}
}