import java.util.Arrays;
import java.util.Scanner;

public class csafs {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int q = sc.nextInt();
		int[] arr = new int[n];
		int[] ss = new int[31];
		int[] pp = new int[31];
		for(int i=0;i<31;i++){
			if(i==0){
				pp[i]=1;
			}else{
				pp[i]=2*pp[i-1];
			}
		}
		for(int i=0;i<n;i++){
			arr[i]=sc.nextInt();
			ss[(int) (Math.log(arr[i])/Math.log(2))]++;
		}
//		System.out.println(Arrays.toString(ss));
		for(int i=0;i<q;i++){
			int t = sc.nextInt();
			int[] sss = ss.clone();
			int count = 0;
			int flag=0;
			for(int j=30;j>=0;j--){
				if(t==0){
					System.out.println(count);
					flag=1;
					break;
				}
				if(t>=pp[j] && sss[j]>0){
					if(sss[j]>=t/pp[j]){
						count+=t/pp[j];
						t=t%pp[j];
						sss[j]-=t/pp[j];
						
					}else{
						t-=sss[j]*pp[j];
						count+=sss[j];
						sss[j]=0;
						
					}
					
				
				}
				
			}
			if(flag==0){
				System.out.println(-1);
			}
			
		}
		
				
	}

}
