import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;

public class CoinsandQueries {
	static int highestPowerof2(int n) {

		return Integer.highestOneBit(n);
	}

	void solve(Scanner in, PrintWriter out) {

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

		HashSet hs = new HashSet();
		for (int i = 0; i < n; i++) {
			hs.add(in.nextInt());

		}
		for (int i = 0; i < q; i++) {
			int v = in.nextInt();
			int ov = v;
			int mp = highestPowerof2(v);
			long cnt = 0;
			long sum = 0;
			while (mp > 0) {

				if (hs.contains(mp)) {
					int c = v / mp;
					cnt += c;
					sum += (c * mp);
					v = v - (c * mp);
				}
				mp = mp >> 1;

			}

			if (sum != ov)
				out.println(-1);
			else
				out.println(cnt);
		}

	}

	void run() {
		try (Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out);) {
			solve(in, out);
		}
	}

	public static void main(String args[]) {
		new CoinsandQueries().run();
	}
}
