import java.io.*;
import java.util.*;

public class Main {


    public static void main(String[] args) throws IOException {
//        out = new PrintWriter(new File("output.txt"));
//        br = new BufferedReader(new FileReader(new File("input.txt")));
        int GOVNO = 1;
        for (int NASRAL = 0; NASRAL < GOVNO; NASRAL++) {
            int n = nextInt();
            int q = nextInt();
            int[] all = new int[34];
            int st = 1;
            for (int i = 0; i < 34; i++) {
                all[i] = st;
                st *= 2;
            }
            int[] have = new int[34];
            for (int i = 0; i < n; i++) {
                int a = nextInt();
                st = 1;
                int cnt = 0;
                while (st < a) {
                    st *= 2;
                    cnt++;
                }
                have[cnt]++;
            }
//            int[] plus = new int[34];
//            int prib = 0;
//            for (int i = 0; i < 33; i++) {
//                if (have[i] > 1) {
//                    have[i + 1] += have[i] / 2;
//                    prib = have[i] / 2;
//                    if (have[i] % 2 == 0) {
//                        have[i + 1]--;
//                        prib--;
//                        have[i] = 2;
//                    } else have[i] = 1;
//                    plus[i + 1] = prib;
//                }
//            }
            for (int i = 0; i < q; i++) {
                int b = nextInt();
                st = 1;
                int cnt = 0;
                int[] now = new int[34];
                System.arraycopy(have, 0, now, 0, 34);
                boolean can = true;
                int ans = 0;
                while (b >= st) {
                    if (her_one(b, st)) {
                        int jopa = st;
                        int ind = cnt;
                        int nasral = st;
                        while (jopa != 0 && ind != -1) {
                            if (now[ind] != 0) {
                                if (now[ind] * nasral > jopa) {
                                    int l = 0;
                                    int r = nasral + 1;
                                    while (l + 1 != r) {
                                        int mid = (l + r) / 2;
                                        if (mid * nasral <= jopa) l = mid;
                                        else r = mid;
                                    }
                                    jopa = 0;
                                    ans += l;
                                } else {
                                    jopa = 0;
                                    ans += now[ind];
                                }
                            } else {
                                nasral /= 2;
                                ind--;
                            }
                        }
                        if (ind == -1) {
                            can = false;
                            break;
                        }
                    }
                    st *= 2;
                    cnt++;
                }
                if (can) out.println(ans);
                else out.println(-1);
            }
        }
        out.close();
    }

    static boolean her_one(int a, int st) {
        return (a & st) == st;
    }

    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter out = new PrintWriter(System.out);
    static StringTokenizer in = new StringTokenizer("");


    public static String next() throws IOException {
        while (in == null || !in.hasMoreTokens()) {
            in = new StringTokenizer(br.readLine());
        }
        return in.nextToken();
    }

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

    public static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
}

class Point {
    int ost;
    int ind;

    public Point(int ost, int ind) {
        this.ost = ost;
        this.ind = ind;
    }
}