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
 */
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);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.ni();
            int q = in.ni();
            StringBuilder sb = new StringBuilder();
            int[] ar = new int[32];
            outer:
            for (int i = 0; i < n; ++i) {
                int curr = in.ni();
                int y = 1;
                for (int j = 0; j < 32; ++j) {
                    if ((curr & (y << j)) > 0) {
                        ar[j]++;
                        continue outer;
                    }
                }
            }
            while (q-- > 0) {
                int result = 0;
                int num = in.ni();
                for (int i = 31; i > -1; --i) {
                    int y = num >>> i;
                    int curr = Math.min(y, ar[i]);
                    num -= curr << i;
                    result += curr;
                }
                if (num == 0) sb.append(result + "\n");
                else sb.append("-1\n");
            }
            out.print(sb);
        }

    }

    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 ni() {
            return Integer.parseInt(next());
        }

    }
}

