import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Task solver = new Task();
		solver.solve(1, in, out);
		out.close();
	}

	static class Task {
		public void solve(int testNumber, InputReader in, PrintWriter out) {
			int n = in.nextInt();
			int q = in.nextInt();
			int[] a = new int[n];
			int[] pow = new int[31];
			for (int i = 0; i <= 30; i++) {
				pow[i] = 1 << i;
			}
			Map<Integer, Integer> map = new HashMap<Integer, Integer>();
			for (int i = 0; i < n; i++) {
				a[i] = in.nextInt();
				if (map.get(a[i]) == null) {
					map.put(a[i], 1);
				} else {
					map.put(a[i], map.get(a[i]) + 1);
				}
			}
			for (int i = 0; i < q; i++) {
				int b = in.nextInt();
				int count = 0;
				for (int j = 30; j >= 0; j--) {
					if (b < pow[j] || map.get(pow[j]) == null)
						continue;
					int can = b / pow[j];
					int avai = map.get(pow[j]);
					int greed = Math.min(can, avai);
					count += greed;
					b -= pow[j] * greed;
					if (b == 0) {
						break;
					}
				}
				if (b == 0) {
					out.println(count);
				} else {
					out.println(-1);
				}
			}
		}
	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public Long nextLong() {
			return Long.parseLong(next());
		}

		public Double nextDouble() {
			return Double.parseDouble(next());
		}
	}
}