import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.Map;
import java.util.HashMap;
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
 */
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();
            Map<Integer, Integer> countMap = new HashMap<>();
            for (int i = 0; i < n; i++) {
                int pow2 = toPow2(in.nextInt());
                countMap.compute(pow2, (k, v) -> v == null ? 1 : v + 1);
            }

            for (int t = 0; t < q; t++) {
                int x = in.nextInt();

                int ans = 0;
                for (int i = 30; i >= 0 && x > 0; --i) {
                    int need = Math.min(x >> i, countMap.getOrDefault(i, 0));
                    ans += need;
                    x -= (1 << i) * need;
                }
                if (x == 0) {

                    out.println(ans);
                } else {
                    out.println(-1);
                }
            }
        }

        int toPow2(long num) {
            int count = 0;
            long mask = 1;
            while ((num & mask) == 0) {
                mask = mask << 1L;
                count++;
            }
            return count;
        }

    }

    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());
        }

    }
}

