import java.util.*;
public class Coins_and_Queries {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int q = in.nextInt();
        int[] freq = new int[32];
        int temp, x;
        for (int i = 0; i < n; i++) {
            x = in.nextInt();
            temp = (int) (Math.log(x)/Math.log(2));
            freq[temp]++;
        }
        int b, ans;
        for (int i = 0; i < q; i++) {
            ans = 0;
            b = in.nextInt();
            if(b % 2 == 1){
                System.out.println("-1");
            }
            else{
                int div, min;
                for (int j = 31; j >= 0; j--) {
                    temp = (int)(Math.pow(2, j));
                    div = b / temp;
                    min = Math.min(div, freq[j]);
                    ans += min;
                    b -= (min * temp);
                }
                if(b == 0)
                    System.out.println(ans);
                else
                    System.out.println("-1");
            }
        }
    }
}
