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

public class ProblemC {

	String fileName = "prizes";

	public static int log2(int n) {
		int res = 0;
		while (n > 0) {
			res++;
			n /= 2;
		}
		return res - 1;
	}

	public void solve() throws IOException {
		int n = nextInt();
		int q = nextInt();
		int coin[] = new int[40];
		for (int i = 0; i < n; i++) {
			int tmp = log2(nextInt());
			coin[tmp]++;
		}
		int used[] = new int[40];
		for (int i = 0; i < q; i++) {
			Arrays.fill(used, 0);
			int quest = nextInt();
			int lay = 0;
			while (quest > 0 && lay < 40) {
				used[lay] += quest % 2;
				quest /= 2;
				lay++;
			}

			for (int j = 39; j >= 0; j--) {
				if (used[j] > coin[j]) {
					if (j != 0) {
						used[j - 1] += 2 * (used[j] - coin[j]);
						used[j] = coin[j];
					} else {
						used[0] = -1;
					}
				}
			}
			if (used[0] != -1 && used[0] <= coin[0]) {
				int ans = 0;
				for (int j = 0; j < 39; j++)
					ans += used[j];
				out.println(ans);
			} else
				out.println(-1);
		}
	}

	public void run() {
		try {

			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out, true);

			// out = new PrintWriter(fileName + ".out");
			// br = new BufferedReader(new FileReader(fileName + ".in"));
			// out = new PrintWriter(fileName + ".out");
			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	BufferedReader br;
	StringTokenizer in;
	static PrintWriter out;

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

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

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

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

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

}