import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author kessido
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DCoinsAndQueries solver = new DCoinsAndQueries();
        solver.solve(1, in, out);
        out.close();
    }

    static class DCoinsAndQueries {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.NextInt();
            int q = in.NextInt();
            int[] powers = new int[32];
            for (int i = 0; i < n; i++) {
                int x = IntegerExtension.getNumberOfBits(in.NextInt()) - 1;
                powers[x]++;
            }
            int[] cost = new int[32];
            LOOP:
            for (int qq = 0; qq < q; qq++) {
                System.arraycopy(powers, 0, cost, 0, 32);
                int res = 0;
                int x = in.NextInt();
                for (int i = 31; i >= 0; i--) {
                    if ((x & (1 << i)) != 0) {
                        int current = 1;
                        int j = i;
                        while (j >= 0 && current > 0) {
                            int delta = Math.min(current, cost[j]);
                            res += delta;
                            current -= delta;
                            j--;
                            current <<= 1;
                        }
                        if (current > 0) {
                            out.println(-1);
                            continue LOOP;
                        }
                    }
                }
                out.println(res);
            }
        }

    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine(), " \t\n\r\f,");
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int NextInt() {
            return Integer.parseInt(next());
        }

    }

    static class IntegerExtension {
        public static int getNumberOfBits(long i) {
            return 64 - Long.numberOfLeadingZeros(i);
        }

    }
}

