import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author mostafa
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DCoinsAndQueries solver = new DCoinsAndQueries();
        solver.solve(1, in, out);
        out.close();
    }

    static class DCoinsAndQueries {
        final int sz = 32;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int q = in.nextInt();

            int[] a = new int[sz];

            for (int i = 0; i < n; i++) {
                int x = in.nextInt();
                int key = (int) (Math.log10(x) / Math.log10(2));
                a[key]++;
            }

            while (q-- > 0) {
                int x = in.nextInt();
                int ans = 0;

//            int [] a = new int[sz] ;
//            a = Arrays.copyOf(b,b.length);


                for (int i = sz - 1; i >= 0; i--) {
                    if (a[i] > 0) {
                        int val = (int) (Math.pow(2, i));
                        if (x >= val) {
                            int num = x / val;
                            if (num <= a[i]) {
                                x -= (num * val);
                                ans += num;
                            } else {
                                x -= (a[i] * val);
                                ans += a[i];
                            }
                        }
                    }
                }

                out.println(x > 0 ? "-1" : ans);

            }
        }

    }

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

    }
}

