import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
 
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);	
		Map<Long,Integer> map=new HashMap();
		int n=sc.nextInt();
		int q=sc.nextInt();
	    long value[]=new long[34];//价值输入
	    int number[]=new int[34];
	    value[0]=1;map.put((long) 1, 0);
	    for(int i=1;i<34;i++)
	    {
	    	value[i]=2*value[i-1];
	    	map.put( value[i], i);
	    	//System.out.println(value[i]);
	    }
		//int qury[]=new int[q];//请求
		
		for(int i=0;i<n;i++)
		{
			long input=sc.nextInt();int getint=map.get(input);
			number[getint]++;
		}
		int t=33;int count=0;
		while(q-->0)
		{
			int sea=sc.nextInt();	
			 count=0;
			for(int i=t;i>=0;i--)
			{
				int num=number[i];
				if(sea<value[i]||num==0) {continue;}
			    if(sea>=value[i]&&num>0) {
			    	int numb1=(int) (sea/value[i]);			    						
					sea-=value[i]*numb1;
					count+=numb1;											
			    }
				if(sea==0) {break;}
			}
			if(sea==0)
			 {System.out.println(count);}
			else
				{System.out.println(-1);}			
		}
	}
}
