

import java.util.*;

public class second
{	
	public static void main(String[] args)
	{	Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int q=sc.nextInt();
		int[] countpowers=new int[31];
		int[] power=new int[31];
		power[0]=1;
		power[1]=2;
		for(int i=2;i<31;i++)
			power[i]=2*power[i-1];
		for(int i=0;i<n;i++)
			countpowers[(int) (Math.log(sc.nextInt())/Math.log(2))]++;
		for(int rep=0;rep<q;rep++)
		{	int number=sc.nextInt();
			int answer=0;
			for(int i=30;i>=0;i--)
			{	if(number>=power[i])
				{	int count=Math.min((int)(number/power[i]),countpowers[i]);
					number-=power[i]*count;
					answer+=count;
				}
			}
			if(number!=0)
				System.out.println(-1);
			else
				System.out.println(answer);
		}
	}
}