// //package ;
import java.io.*;
import java.util.*;

public class D
{
	public static void main(String[] args) throws IOException 
	{
		Scanner sc = new Scanner();
		PrintWriter pw = new PrintWriter(System.out);
		int n=sc.nextInt(),q=sc.nextInt();
		int[]p=new int[31];
		long sum=0;
		while(n-->0)
		{
			long x=sc.nextLong();
			sum+=x;
			double k=Math.log(x)/Math.log(2);
			p[(int)k]++;
		}
		while(q-->0)
		{
			int x=sc.nextInt();
			if((x%2==1 && p[0]==0) || x>sum)
				System.out.println(-1);
			else
			{
				int[]p1=p.clone();
				long total=0;int c=0;
				long tmp=x;
				while(total<x)
				{
					int i=(int)(Math.log(tmp)/Math.log(2));
					int mul=1;
					while(p1[i]==0)
					{
						i--;
						mul++;
					}
					if(p1[i]<mul)
						mul=p1[i];
					p1[i]-=mul;
					tmp-=Math.pow(2, i)*mul;
					total+=Math.pow(2, i)*mul;
					c++;
				}
				if(total==x)
					pw.println(c);
				else
					pw.println(-1);
				
			}
		}
		pw.close();    
	}
	static class Scanner {
		BufferedReader br;
		StringTokenizer st;
		
		Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		
		String next() throws IOException {
			while (st == null || !st.hasMoreTokens()) {
				st = new StringTokenizer(br.readLine());
			}
			return st.nextToken();
		}
		
		int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
		
		long nextLong() throws IOException {
			return Long.parseLong(next());
		}
		
		double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
		
		String nextLine() throws IOException {
			return br.readLine();
		}
		boolean hasnext() throws IOException{
			return br.ready();
		}
		
	}
}
