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


public class test {
    int INF = (int)1e9;
    long MOD = 1000000007;
    
    
    int get(int[] p, int i) {
        if(p[i]>0) {
            p[i]--;
            return 1;
        }
        i--;
        int s = 2;
        while(i>=0 && p[i]<s) {
            s -= p[i];
            p[i] = 0;
            s *= 2;
            i--;
        }
        if(i<0 || p[i]<s) return -1;
        else {
            p[i] -= s;
            return s;
        }
    }
    
    void solve(InputReader in, PrintWriter out) throws IOException {
        int n = in.nextInt();
        int q = in.nextInt();
        int[] p = new int[40];
        double log2 = Math.log(2);
        for(int i=0; i<n; i++) {
            int ai = in.nextInt();
            int e = (int)(Math.log(ai)/log2);
            p[e]++;
        }
        loop: while(q-->0) {
            int a = in.nextInt();
            String b = "";
            while(a>0) {
                b = (a%2) + (b);
                a /= 2;
            }
            int[] c = Arrays.copyOf(p, 33);
            int rs = 0;
            int[] x = new int[40];
            for(int i=0; i<b.length(); i++) {
                if(b.charAt(i)=='1') {
//                    int r = get(c, i);
//                    if(r==-1) {
//                        out.println(-1);
//                        continue loop;
//                    }
//                    rs += r;
                    x[i]++;
                }
            }
            for(int i=b.length(); i>=0; i--) {
                if(c[i]<=x[i]) {
                    int d = x[i] - c[i];
                    x[i] = c[i];
                    if(i==0) {
                        if(d>0) {
                            out.println(-1);
                            continue loop;
                        }
                    }
                    if(i>0) {
                        x[i-1] += 2 * d;
                    }
                }
            }
            for(int i=0; i<=32; i++) {
                rs += x[i];
            }
            out.println(rs);
        }
    }
    
    
    public static void main(String[] args) throws IOException {
        if(args.length>0 && args[0].equalsIgnoreCase("d")) {
            DEBUG_FLAG = true;
        }
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;//in.nextInt();
        long start = System.nanoTime();
        while(t-- >0) {
            new test().solve(in, out);
        }
        long end = System.nanoTime();
        debug("\nTime: " + (end-start)/1e6 + " \n\n");
        out.close();
    }
    
    static boolean DEBUG_FLAG = false;
    static void debug(String s) {
        if(DEBUG_FLAG) System.out.print(s);
    }
    
    static class InputReader {
        static BufferedReader br;
        static StringTokenizer st;
    
        public InputReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        
        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        int nextInt() {
            return Integer.parseInt(next());
        }
        
        long nextLong() {
            return Long.parseLong(next());
        }
        
        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}