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

public class Main {
    static class Reader {
        BufferedReader in;

        Reader() throws IOException {
            in = new BufferedReader(new InputStreamReader(System.in));
        }

        Reader(String name) throws IOException {
            in = new BufferedReader(new FileReader(name));
        }

        StringTokenizer tokin = new StringTokenizer("");

        String next() throws IOException {
            if (!tokin.hasMoreTokens()) {
                tokin = new StringTokenizer(in.readLine());
            }
            return tokin.nextToken();
        }

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

    }
    static class Writer {
        PrintWriter cout;

        Writer() throws IOException {
            cout = new PrintWriter(System.out);
        }

        Writer(String name) throws IOException {
            cout = new PrintWriter(new FileWriter(name));
        }

        StringBuilder out = new StringBuilder();

        void print(Object a) {
            out.append(a);
        }

        void println(Object a) {
            out.append(a + "\n");
        }

        void close() {
            cout.print(out.toString());
            cout.close();
        }
    }

    static int p[];

    public static void main(String args[]) throws IOException {
        Reader in = new Reader();
        Writer out = new Writer();
        int n = in.nextInt();
        int q = in.nextInt();
        p = new int[31];
        for (int i = 0; i < n; i++) {
            int a = in.nextInt();
            int pa = 0;
            while(a != 1) {
                a = a >> 1;
                pa++;
            }
            p[pa]++;
        }
        for (int i = 0; i < q; i++) {
            int b = in.nextInt();
            int ans = 0;
            for (int j = 30; j >= 0 && b > 0; j--) {
                int need = Math.min(b >> j, p[j]);
                ans += need;
                b -= (1 << j) * need;
            }
            if(b > 0){
                out.println(-1);
            } else {
                out.println(ans);
            }
        }
        out.close();
    }
}
