import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import java.util.*;
public class A_GENERAL {

	static long c = 0;
	private static int[] parent;
	public static void main(String[] args) {
		
		MyScanner sc = new MyScanner();
		
		int n = sc.nextInt();
		int q = sc.nextInt();
		int[] twolist = new int[51];
		int maxLog = 0;
		for(int i = 0; i < n; i++) {
			long x = sc.nextLong();
			int logx = (int)(Math.log(x)/Math.log(2)+1e-10);
			twolist[logx]++;
			maxLog = Math.max(logx, maxLog);
		}
//		for(int i = 0; i < 50; i++)
//			System.out.println("twolist["+ i + "] = " + twolist[i]);
		
		while(q-- > 0) {
			
			long x = sc.nextLong();
			int c = 0;
			for(int i = maxLog; i >= 0; i--) {
				long p = (long) Math.pow(2, i);
				if(twolist[i] > 0) {
					if(x >= i) {
						int fact = (int) Math.min(x/p, twolist[i]);
						x -= p*fact;
						c += fact;
					}
					
				}
			}
//			System.out.println("x = " + x);
			if(x == 0)
				System.out.println(c);
			else
				System.out.println(-1);
			
		}
	}

	static class MyScanner {
		BufferedReader br;
		StringTokenizer st;
		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		String next() {while (st == null || !st.hasMoreElements()) {
			try {st = new StringTokenizer(br.readLine());}
			catch (IOException e) {e.printStackTrace();}}
		return st.nextToken();}
		int nextInt() {return Integer.parseInt(next());}
		long nextLong() {return Long.parseLong(next());}
		double nextDouble() {return Double.parseDouble(next());}
		String nextLine(){String str = "";
		try {str = br.readLine();}
		catch (IOException e) {e.printStackTrace();}
		return str;}
	}
	
}