//codeforces_1003_D

import java.io.*;
import java.util.*;
import static java.lang.Math.*;
import java.math.*;

public class acm {
    
    public static void main(String[] args) throws IOException {
        BufferedReader gi = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter go = new PrintWriter(System.out);
        int[] line = parseArray(gi);
        int n = line[0];
        int q = line[1];
        int[] bits = new int[64];
        line = parseArray(gi);
        String temp;
        for (int k = 0; k<n; k++){
            bits[toBinaryString(line[k]).length() - 1]++;
        }
        int ans,accumulator;
        int err;
        for (int k = 0; k<q; k++){
            temp = toBinaryString(Integer.parseInt(gi.readLine()));
            ans = 0;
            accumulator = 0;
            err = 0;
            for (int j = temp.length()-1; j>=0; j--){
                accumulator <<= 1;
                err = temp.charAt(j) == '1'?1:0;
                accumulator += err;
                ans += min(accumulator,bits[j]);
                accumulator -= min(accumulator,bits[j]);
            }
            go.println(accumulator>0?-1:ans);
        }

        go.close();
    }
    
    static String toBinaryString(long n){//reversed
        StringBuilder sb = new StringBuilder();
        while (n > 0){
            sb.append(n&1);
            n >>= 1;
        }
        return sb.toString();
    }
    
    static int[] parseArray(BufferedReader  gi) throws IOException{
        String[] line = gi.readLine().split(" ");
        int[] ans = new int[line.length];
        for (int k = 0; k< line.length; k++){
            ans[k] = Integer.parseInt(line[k]);
        }
        return ans;
    }
}