import java.util.*;
import java.io.*;
public class coins
{
	public static void main(String[] args) throws IOException
	{
		//final long startTime = System.nanoTime();
		//String ss=new String("");

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int q = Integer.parseInt(st.nextToken());
		st = new StringTokenizer(br.readLine());

		int[] arr=new int[31];
		long[] qq=new long[q];
		for(int i=0;i<31;i++)
			arr[i]=0;
		long l;
		int pow;
		int count=0;
		for(int i=0;i<n;i++)
		{
			pow=0;
			//l=s.nextLong();
			l=Integer.parseInt(st.nextToken());
			pow=(int)Math.round(Math.log(l)/Math.log(2));
			
			arr[pow]++;
		}
		for(int i=0;i<q;i++)
		{
			count=0;
			long query;//=s.nextLong();	
			query = Integer.parseInt(br.readLine());
			
			for(int j=30;j>=0;j--)
			{
				long k=(long)Math.pow(2,j);
				long min=Math.min(arr[j],(query/k));
				query-=min*k;
				count+=min;
				if(query==0||query<0)
					break;
			}
			

			if(query!=0)
			{
				qq[i]=-1;
			}
			else
			{
				qq[i]=count;
			}
		}

		for(int i=0;i<qq.length;i++)
			System.out.println(qq[i]);
		
	}
}