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

public class Main {
    private static class Solver {
        int log2(int n) {
            for (int i = 0; i < 31; ++i) {
                if ((1 << i) == n) {
                    return i;
                }
            }
            return -1;
        }
        private void Solve() {
            int n = inp.nextInt();
            int q = inp.nextInt();
            int[] a = new int[31];
            for (int i = 0; i < 31; ++i) {
                a[i] = 0;
            }
            for (int i = 0; i < n; ++i) {
                a[log2(inp.nextInt())] += 1;
            }
            for (int i = 0; i < 30; ++i) {
                if (a[i] > 0) {
                    int t = (a[i] - 1) / 2;
                    a[i] -= t * 2;
                    a[i + 1] += t;
                }
            }

            for (; q > 0; --q) {
                int x = inp.nextInt();
                int ans = 0;
                for (int i = 0; i < 31; ++i) {
                    if ((x >> i & 1) == 0) {
                        continue;
                    }
                    if (a[i] == 0) {
                        ans = -1;
                        break;
                    }
                    ans += 1;
                }
                out.println(ans);
            }
        }
        static InputReader inp;
        static PrintWriter out;
    }

    private static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

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

        private String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        private int nextInt() {
            return Integer.parseInt(next());
        }
        private long nextLong() {
            return Long.parseLong(next());
        }
        private int[] nextArrayInt(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; ++i) {
                a[i] = nextInt();
            }
            return a;
        }
    }
    public static void main(String[] args) throws IOException {
        if (!"true".equals(System.getProperty("ONLINE_JUDGE"))) {
            System.setIn(new FileInputStream(new File("input.txt")));
        }
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Solver.inp = new InputReader(inputStream);
        Solver.out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.Solve();
        Solver.out.close();
    }
}