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

public class Coins {
        public static void main(String[] args) throws IOException {
                Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
                PrintWriter out = new PrintWriter(System.out);

                int n = sc.nextInt();
                int q = sc.nextInt();

                int[] coins = new int[31];

                for(int i = 0; i < n; i++)
                        coins[(int) (Math.log(sc.nextInt())/ Math.log(2))]++;

                while(q-- > 0) {
                        int query = sc.nextInt();
                        int count = 0;

                        for(int j = (int) (Math.log(query)/Math.log(2)); j >= 0; j--){
                                int tmp = (int) (Math.min(query/(Math.pow(2,j)), coins[j]));
                                query -= Math.pow(2, j) * tmp;
                                count += tmp;

                                if(query <= 0) break;
                        }

                        if(query != 0) count = -1;

                        out.println(count);
                }
                out.close();
        }
}
