import java.util.*;
import java.lang.*;

public class Coins {
        public static void main(String[] args) {
                Scanner sc = new Scanner(System.in);

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

                int[] coins = new int[31];

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

                for(int i = 0; i < q; i++) {
                        int query = sc.nextInt();
                        int count = 0;
                        if(query != 1 && query % 2 != 0) {
                                count = -1;
                                System.out.println(count);
                                continue;
                        }

                        int query_2 = (int) (Math.log(query)/Math.log(2));

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

				if(query <= 0) break;	
				else 
					if(j == 0 && query != 0) count = -1;
                        }
			
			if(query < 0) count = -1; 

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