import java.io.*;
import java.util.*;
import java.lang.*;
import java.math.BigInteger;
import java.math.BigDecimal;

public class Main {

    static class Task {

        void solve(int test, FastScanner in, PrintWriter out) throws IOException {
            int n = in.nextInt();
            int q = in.nextInt();
            int[] a = new int[n];
            TreeMap<Integer, Integer> map = new TreeMap<>();
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
                map.put(a[i], map.getOrDefault(a[i], 0) + 1);
            }

            int[] f = new int[31];
            f[0] = 1;
            for (int i = 1; i <= 30; i++) {
                f[i] = 2 * f[i - 1];
            }

            for (int i = 0; i < q; i++) {
                int v = in.nextInt();
                int c = 0;
                for (int j = 30; j >= 0; j--) {
                    if (f[j] <= v) {
                        if (!map.containsKey(f[j])) continue;
                        if ((v / f[j]) <= map.get(f[j])) {
                            v -= (v / f[j]) * f[j];
                        } else {
                            v -= map.get(f[j]) * f[j];
                        }
                        c++;
                    }
                }
                if (v == 0) {
                    out.println(c);
                } else {
                    out.println("-1");
                }
            }
        }
    }

    public static void main(String[] args) throws IOException {
        FastScanner in = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
//        FastScanner in = new FastScanner("input.txt");
//        PrintWriter out = new PrintWriter(new FileWriter("output.txt"));
        new Task().solve(1, in, out);
        out.close();
    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer token;

        public FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastScanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public String nextToken() {
            while (token == null || !token.hasMoreTokens()) {
                try {
                    token = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return token.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextToken());
        }

        public long nextLong() {
            return Long.parseLong(nextToken());
        }

        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}