import java.util.Scanner;

public class hi {
	
public static void main(String args[]) {
	Scanner sc=new Scanner(System.in);
	int n=sc.nextInt();
	int q=sc.nextInt();
	int[] coin=new int[n];
	int[] freq=new  int[33];
	int t=0;
	
	for(int i=0;i<33;i++)
	{
		freq[i]=0;
	}
	
	for(int i=0;i<n;i++)
	{
		coin[i]=sc.nextInt();
		
			t=(int)(Math.log(coin[i])/Math.log(2));
			freq[t]++;
	}
	for(int i=0;i<33;i++) {
		System.out.print(freq[i]);
	}
	while(q-- > 0) {
		
		int qr=sc.nextInt();
		int answer=0;
		int y=0;
		Long k=(long)1;
		for (int j = 1; j < 33; j++)
		{
			k *= 2;
		}
		for(int j=32;j>=0;j--) {
			if(k>0) {
			y=(int) Math.min(freq[j], qr/k);
			qr=(int) (qr-y*k);
			answer=answer+y;
			k=k/2;
		}
		}
		if(qr==0)
		{
			System.out.println(answer);
		}
		else
			System.out.println("-1");
		
	}
	
}
}