import java.util.Scanner;

public class CoinsAndQueries {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt(), q = s.nextInt();
        int[] amount = new int[31];
        int[] powers = new int[31];
        for (int i = 0; i < 31; i++) powers[i] = (int) Math.pow(2, i);
        for (int i = 0; i < n; i++) {
            int a = s.nextInt();
            int c = -1;
            while (a != 0) {
                a = a >>> 1;
                c++;
            }
            amount[c] += 1;
        }

        for (int i = 0; i < q; i++) {
            int num = s.nextInt();
            int coins = 0;
            for (int j = 30; j >= 0 && num > 0; j--) {
                int c = Math.min(num >>> j, amount[j]);
                num -= c * powers[j];
                coins += c;
            }
            if (num == 0) System.out.println(coins);
            else System.out.println("-1");
        }
    }
}
