import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        new Solver().run(1);
    }
}

class Solver {

    private BufferedReader reader = null;
    private StringTokenizer st = null;

    private long[] cnt = new long[32];
    private long[] aux = new long[32];
    private long n, q;

    public void run(int inputType) throws Exception {
        if (inputType == 0)
            reader = new BufferedReader(new FileReader("input.txt"));
        else
            reader = new BufferedReader(new InputStreamReader(System.in));

        st = new StringTokenizer(reader.readLine());
        n = Integer.parseInt(st.nextToken());
        q = Integer.parseInt(st.nextToken());
        st = new StringTokenizer(reader.readLine());

        for (int i = 0; i < n; ++i) {
            long v = Integer.parseInt(st.nextToken());
            int j = 0;
            for (; ((1 << j) & v) == 0; ++j);
            cnt[j]++;
        }

        for (int i = 0; i < q; ++i) {

            long b = Integer.parseInt(reader.readLine());

            boolean success = true;
            long coins = 0;

            for (int j = 31; j >= 0; --j) {

                if ((b & (1 << j)) == 0)
                    continue;

                long amount = 1;
                for (int t = j; t >= 0; --t) {

                    if (cnt[t] >= amount) {
                        cnt[t] -= amount;
                        aux[t] += amount;
                        coins += amount;
                        amount = 0;
                        break;
                    }

                    if (cnt[t] > 0) {
                        amount -= cnt[t];
                        coins += cnt[t];
                        aux[t] += cnt[t];
                        cnt[t] = 0;

                        amount *= 2;
                        continue;
                    }

                    amount *= 2;
                }

                if (amount > 0) {
                    success = false;
                    break;
                }
            }

            System.out.println((success) ? coins : -1);

            for (int j = 0; (1 << j) <= b; ++j) {

                if (((1<<j) & b) == 0)
                    continue;

                cnt[j] += aux[j];
                aux[j] = 0;
            }
        }

        reader.close();
    }
}
