
import java.io.*;
import java.util.*;

public class D {

	public static void main(String[] args) throws IOException {
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int q = scn.nextInt();

		int f[] = new int[31];
		for (int i = 0; i < n; i++) {
			int x = scn.nextInt();
			StringBuilder sb = new StringBuilder(Integer.toBinaryString(x)).reverse();
			for (int j = 0; j < sb.length(); j++) {
				if (sb.charAt(j) - '0' == 1)
					f[j]++;
			}
		}

		while (q-- > 0) {
			int b[] = Arrays.copyOfRange(f, 0, f.length);
			int v = scn.nextInt();
			int cnt = 0;
			boolean bo = true;
			StringBuilder sb = new StringBuilder(Integer.toBinaryString(v)).reverse();
			A: for (int j = sb.length() - 1; j >= 0; j--) {
				if (sb.charAt(j) == '0')
					continue;
				int idx = j;
				if (b[idx] >= 1) {
					cnt++;
					b[idx]--;
					continue;
				}
				while (idx != -1 && b[idx] < 2) {
					if (b[idx] == 1) {
						cnt++;
						b[idx] = 0;
					}
					idx--;
				}
				if (idx == -1)
					bo = false;
				else {
					cnt += 2;
					b[idx] -= 2;
				}
				break A;
			}
			System.out.println(bo ? cnt : -1);
		}
	}

	static class Scanner {

		StringTokenizer st;
		BufferedReader br;

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

		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());
		}
	}
}