import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class D {
    static final int maxN = 200005;
    static int[] a = new int[maxN];
    static int[] b = new int[maxN];

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        int q = in.nextInt();
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        Arrays.sort(a, 0, n);
        for (int i = 0; i < n; i++) {
            if (i > 0 && a[i] == a[i - 1]) b[i] = b[i - 1];
            else {
                b[i] = i - 1;
            }
        }
        while (q != 0) {
            q--;
            int x = in.nextInt();
            System.out.println(solve(x, n - 1));
        }
        out.close();
    }

    static int solve(int x, int y) {
        if (x == 0) return 0;
        if (y == -1) return -1;
        int d = Math.min(x / a[y], y - b[y]);
        int z = solve(x - d * a[y], b[y]);
        if (z == -1) return -1;
        else return z + d;
    }

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

    }
}