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

public class D {

	static int n, m;
	static int[] a;
	static StringBuilder st = new StringBuilder();

	public static void main(String[] args) throws IOException {

		Scanner sc = new Scanner(System.in);

		n = sc.nextInt();
		int q = sc.nextInt();

		a = new int[32];
		while (n-- > 0) {
			int x = sc.nextInt();
			int power = 1 << 30;
			int i = 30;
			while (power > 0) {
				if (power == x) {
					a[i]++;
					break;
				}
				power >>= 1;
				i--;

			}

		}

		outer: while (q-- > 0) {

			int ans = 0;
			long take = 0;
			long target = sc.nextInt();
			for (long v = 1 << 30, i = 30; v > 0; v >>= 1, i--) {
				if (a[(int) i] == 0)
					continue;

				long start = 0;
				long end = a[(int) i];
				long an = 0;

				while (start <= end) {
					long mid = start + (end - start) / 2;
					if (v * mid + take > target) {

						end = mid - 1;
					} else {
						start = mid + 1;
						an = mid;
					}

				}

				take += an * v;
				ans += an;
				if (take == target) {
					st.append(ans).append("\n");
					continue outer;
				}

			}
			st.append(-1).append("\n");

		}

		System.out.println(st);

	}

	static void shuffle(long[] a) {
		int n = a.length;
		for (int i = 0; i < n; i++) {
			int r = i + (int) (Math.random() * (n - i));
			long tmp = a[i];
			a[i] = a[r];
			a[r] = tmp;
		}
	}

	static void shuffle(int[] a) {
		int n = a.length;
		for (int i = 0; i < n; i++) {
			int r = i + (int) (Math.random() * (n - i));
			int tmp = a[i];
			a[i] = a[r];
			a[r] = tmp;
		}
	}

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

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

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

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

	}

}