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 llamaoo7
 */
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[] c = new int[33];
            int n = in.nextInt();
            int q = in.nextInt();
            for (int i = 0; i < n; i++) {
                int cur = in.nextInt();
                for (int j = 0; j < 32; j++)
                    if (cur == 1 << j) {
                        c[j]++;
                        break;
                    }
            }
            for (int i = 0; i < q; i++) {
                int rem = in.nextInt();
                int res = 0;
                for (int j = 30; j >= 0; j--)
                    if (rem >= (1 << j)) {
                        int cur = Math.min(rem >> j, c[j]);
                        rem -= cur * (1 << j);
                        res += cur;
                    }
                out.println(rem > 0 ? -1 : res);
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public 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());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

    }
}

