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

public class CF1003D {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String[] split = br.readLine().split(" ");
		int n = Integer.parseInt(split[0]);
		int q = Integer.parseInt(split[1]);
		int[] freq = new int[50];
		int max = 0;
		split = br.readLine().split(" ");
		for(int i=0; i<n; i++) {
			int x = Integer.parseInt(split[i]);
			int index = (int) (Math.log(x)/Math.log(2));
			max = Math.max(max, index);
			freq[index]++;
		}
		while(q-->0) {
			int x = Integer.parseInt(br.readLine());
			int total = 0;
			int index = max;
			while(x>0 && index>=0) {
				int coinVal = (int) Math.pow(2, index);
				if(coinVal>x || freq[index]==0) {
					index--;
					continue;
				}
				int nCoins = Math.min(x/coinVal, freq[index]);
				if(nCoins==0) continue;
				total+=nCoins;
				x-=(nCoins*coinVal);
				index--;
			}
			sb.append(x==0 ? total : "-1").append("\n");
		}
		System.out.print(sb);
	}
}
