import java.io.*;
import java.util.*;
public class ProblemD {
	public static void main(String[] args) throws IOException {
		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());
		int [] a = new int[35];
		st = new StringTokenizer(br.readLine());
		for(int i = 0;i<n;i++){
			int coin = Integer.parseInt(st.nextToken());
			int arr = (int)Math.round(Math.log(coin) / Math.log(2));
			a[arr]++;
		}
		for(int i = 0;i<q;i++){
			int q1 = Integer.parseInt(br.readLine());
			int ans = 0;
			for(int j = 31;j>=0 ;j--){
				int count = Math.min((q1/(1<<j)) , a[j]);
				ans+=count;
				q1-= (count*(1<<j));
				if(q1 == 0) break;
			}
			if(q1 == 0) System.out.println(ans);
			else System.out.println(-1);
		}
		
	}
}
