import java.util.*;
import java.io.*;
import java.util.Map.Entry;

public class Codeforces {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken()), q = Integer.parseInt(st.nextToken());
        int[] c = new int[n];
        st = new StringTokenizer(br.readLine());
        int[] pow = new int[31];
        for (int i = 0; i < n; i++) {
            c[i] = Integer.parseInt(st.nextToken());
            int p = (int) (Math.log(c[i]) / Math.log(2));
            pow[p]++;
        }
        query: while (q-- > 0) {
            int b = Integer.parseInt(br.readLine());
            int[] tmp = pow.clone();
            int ans = 0, req = 0;
            for(int i = 30; i >= 0; i--){
                if(((1 << i) & b) != 0){
                    req++;
                }
                if(tmp[i] >= req){
                    ans += req;
                    req = 0;
                }else {
                    ans += tmp[i];
                    req -= tmp[i];
                }
                req *= 2;
            }
            if(req == 0){
                System.out.println(ans);
            }else {
                System.out.println(-1);
            }
        }
    }
}