import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

public class D {
    static final int maxN = 200005;
    static List<Integer> a = new ArrayList<>();
    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.add(in.nextInt());
        }
        a.sort(Integer::compareTo);
        b[0] = -1;
        int pos = 0;
        for (int i = 1; i < n; i++) {
            if (a.get(i) == a.get(i - 1)) b[i] = b[i - 1];
            else {
                b[i] = pos;
                pos = i;
            }
        }
        // for (int i = 0; i < n; i++) System.out.println(b[i]);
        while (q != 0) {
            q--;
            int x = in.nextInt();
            System.out.println(solve(x, n - 1));
        }
        out.close();
    }

    static int solve(int x, int y) {
        // System.out.println("solve" + x + " " + y);
        if (x == 0) return 0;
        if (y == -1) return -1;
        if (a.get(y) <= x) {
            int z = solve(x % a.get(y), b[y]);
            if (z == -1) return -1;
            else return z + x / a.get(y);
        } else {
            return solve(x, b[y]);
        }
    }

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

    }
}