//Code by Sounak, IIEST
import java.util.Scanner;
 
public class Main {
	
	private static int[] cnt = new int[40];
	
	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
	
		int i , j , n = scan.nextInt() , q = scan.nextInt();
		for (i = 0;i < n;i ++) {
			int input = scan.nextInt();
			int index = getIndex(input) - 1;
			cnt[index] ++;
		}
		for (i = 0;i < q;i ++) {
			int value = scan.nextInt();
			int ans = 0;
			for (j = 30;j >= 0 && value > 0;j --) {
				int current = (1 << j);
				int need = value / current;
				int temp = Math.min(need , cnt[j]);
				ans += temp;
				value -= temp * current;
			}
			if (value == 0) {
				System.out.println(ans);
			} else {
				System.out.println(- 1);
			}
		}
		
	}
	
	private static int getIndex(int value) {
		
		int ans = 0;
		while (value > 0) {
			value /= 2;
			ans ++;
		}
		return ans;
		
	}
    
}
 
 
 