import java.util.Scanner;

public class CF1003D {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int q = sc.nextInt();
		int[] freq = new int[50];
		int max = 0;
		while(n-->0) {
			int x = sc.nextInt();
			int index = (int) (Math.log(x)/Math.log(2));
			max = Math.max(max, index);
			freq[index]++;
		}
		while(q-->0) {
			int x = sc.nextInt();
			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--;
			}
			System.out.println(x==0 ? total : "-1");
		}
	}
}
