
import java.util.Scanner;

/**
 * Created by makarfi on 7/3/18.
 */
public class D {
    private static long[] coins = new long[65];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt(), q = in.nextInt();

        while (n-- > 0) {
            long num = in.nextLong();
            for (int i = 0; i < 65; i++) {
                if ((num & 1L<<i) == num) {
                    coins[i]++;
                    break;
                }
            }
        }

        StringBuilder builder = new StringBuilder();
        while (q-- > 0) {
            long num = in.nextLong(), count = 0, coinsUsed = 0;
            for (int i = coins.length-1; i >= 0; i--) {
                if ((num & (1L<<i)) == (1L<<i)) {
                    count += 1;
                }
                if (coins[i] >= 1) {
                    long min = Math.min(count, coins[i]);
                    count -= min;
                    coinsUsed += min;
                }
                count *= 2;
            }

            if (count == 0) {
                builder.append(coinsUsed).append("\n");
            } else {
                builder.append(-1).append("\n");
            }
        }

        System.out.print(builder);
    }
}
