import java.util.*;
public class D {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int q = sc.nextInt();
		int[] avail = new int[50];
		for(int i=0;i<n;i++){
			avail[(int) (Math.log(sc.nextLong())/Math.log(2))]++;
		}
		for(int i=0;i<q;i++){
			long temp = sc.nextLong();
			int pos = 32;
			long mask = (long)1<<pos;
			int count=0;
			int flag=0;
			while(mask>0){
				if((mask&temp)!=0){
					long ttt = mask;
					int tpos = pos;
					if(avail[tpos]>0){
						count++;
					}
					else{
						int want = 2;
						while(ttt>0 && tpos>0){
							int minavai = Math.min(avail[tpos-1], want);
							count=count+minavai;
							ttt = ttt-((1<<(tpos-1))*minavai);
							want = (want - minavai)*2;
							avail[tpos-1]=avail[tpos-1]-minavai;
							tpos = tpos-1;
						}
						if(ttt>0 && tpos<=0){
							System.out.println(-1);
							flag=1;
							break;
						}
						
					}
				}
				pos--;
				mask=mask>>1;
				
			}
			
			if(flag==0){
				System.out.println(count);
			}
		}
		
		
	}

}
