
import java.io.*;
import java.util.*;
import java.lang.*;

public class q4cf {

	public static void main(String[] args) throws IOException {
		BufferedReader x=new BufferedReader(new InputStreamReader(System.in));
		String a=x.readLine();
		String[] b=a.split(" ");
		int n=Integer.parseInt(b[0]);
		int q=Integer.parseInt(b[1]);
		String c=x.readLine();
		String[] d=c.split(" ");
		int[] count=new int[31];
		int[] poww=new int[31];
		for (int w=0;w<31;w++) {
			poww[w]=(int)Math.pow(2,w);
		}
		for (int i=0;i<n;i++) {
			for (int j=0;j<31;j++) {
				
				if (poww[j]==Integer.parseInt(d[i])) {
					count[j]+=1;
					break;
				}
			}
		}
		for (int k=0;k<q;k++) {
			int p=Integer.parseInt(x.readLine());
			int cc=0;
			for (int l=30;l>=0;l--) {
				if (count[l]!=0) {
					int f=poww[l];
					int mm=(int)(p/(f));
					int nn=count[l];
					if (mm<=nn) {
						cc+=mm;
						p=(int)(p%(f));
					}
					else {
						cc+=nn;
						
						p=p-f*count[l];
					}
					if (p==0) {
						break;
					}
						
				}
				
					
			}
			if (p==0) {
				System.out.println(cc);
			}
			else {
				System.out.println(-1);
			}
			
		}
		
		
		

	}

}
