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 void solve() throws IOException {
		int n = nextInt();
		int q = nextInt();
		int coin[] = new int[20];
		for (int i = 0; i < n; i++) {
			int tmp = (int) (Math.log(nextInt()) / Math.log(2));
			coin[tmp]++;
		}
		int used[] = new int[20];
		for (int i = 0; i < q; i++) {
			Arrays.fill(used, 0);
			int quest = nextInt();
			int lay = 0;
			while (quest > 0 && lay < 20) {
				used[lay] += quest % 2;
				quest /= 2;
				lay++;
			}
			// for (int j = 0; j < n; j++) {
			// if (used[j] > coin[j]) {
			// if (j > 0) {
			// used[j - 1] += 2;
			// used[j]--;
			// } else
			// used[j] = 2000000;
			// }
			// }
			for (int j = 19; j >= 0; j--) {
				if (used[j] > coin[j]) {
					if (j != 0) {
						used[j - 1] += 2 * (coin[j] - used[j]);
						used[j] = coin[j];
					} else {
						used[0] = -1;
					}
				}
			}
			if (used[0] != -1) {
				boolean ok = true;
				for (int j = 0; j < 20; j++) {
					if (used[j] > coin[j])
						ok = false;
				}
				if (ok) {
					int ans = 0;
					for (int j = 0; j < 20; j++)
						ans += used[j];
					out.println(ans);
				} else
					out.println(-1);
			} 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();
	}

}