// package CF;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class F {

	public static void main(String[] args) throws Exception
	{
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = sc.nextInt(), q = sc.nextInt();
		int [] a = new int[31];
		for (int i = 0; i < n; i++) {
			int tmp = sc.nextInt();
			int pow = 1, idx = 0;
			while(pow < tmp) {
				pow <<= 1;
				idx++;
			}
			a[idx]++;
		}
		while(q-->0){
			int b = sc.nextInt();
			int min = 0;
			for (int i = 30; i >= 0; --i) {
				if(a[i] == 0 || b < 1<<i) continue;
				int lo = 1, hi = a[i], ans = -1;
				while(lo <= hi){
					int mid = (lo + hi)/2;
					if(1l*mid*(1<<i) <= b){
						ans = mid;
						lo = mid+1;
					}
					else hi = mid-1;
				}
				if(ans != -1){
					b -= ans*(1<<i);
					min += ans;
				}
			}
			out.println(b > 0?-1:min);
		}
		out.flush();
		out.close();
	}
	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s)
		{
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(FileReader fileReader)
		{
			br = new BufferedReader(fileReader);
		}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException
		{
			return br.readLine();
		}

		public boolean ready() throws IOException
		{
			return br.ready();
		}
	}
}