import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
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 {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int q = in.nextInt();

            int[] b = new int[31];

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

            while (q-- > 0) {
                int x = in.nextInt();
                char[] binary = Integer.toBinaryString(x).toCharArray();
                int size = binary.length;
                int pow = size - 1;
                int ans = 0;

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

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

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

                if (x > 0) {
                    out.println(-1);
                } else {
                    out.println(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());
        }

    }
}

