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

		Map<Long, Integer> map = new TreeMap<>();

		while (n-- > 0) {
			long x = sc.nextInt();
			map.put(x, map.getOrDefault(x, 0) + 1);
		}
		
		
		outer :while (q-- > 0) {
			
			int ans = 0 ;
			long take = 0;
			long target = sc.nextInt();
			for (long v = 1 << 30; v > 0; v >>= 1) {
				if (!map.containsKey(v))
					continue;
				
				long an = (target-take)/v;
				
				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();
		}

	}

}
