import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.security.KeyStore.Entry;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

import javax.swing.event.TreeSelectionEvent;

public class AA {
	static int k, n, m, b;
	static int[][] arr;
	static int[] premute;
	static TreeMap<Integer, String> map;
	static ArrayList<Long> powers;

	public static long pow(long a, long b) {
		return help(a, b, 0);
	}

	public static long help(long a, long b, int i) {
		if (i == b)
			return 1;
		return a * 1l * help(a, b, i + 1) * 1l;
	}

	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int q = sc.nextInt();
		int[]p = new int[33];
		for(int i = 0;i<n;i++){
			int a = sc.nextInt();
			p[(int)(Math.log10(a)/Math.log10(2))]++;
		}
		while(q-->0){
			int a = sc.nextInt();
			int [] tmp = p.clone();
			int c = 0;
			for(int i = 30;i>=0;i--){
				int s = Math.min(a/(1<<i), p[i]);
				c+=s;
				a -= (1<<i)*s;
			}
			c = a>0?-1:c;
			System.out.println(c);
		}
	}

	public static class Dragons implements Comparable<Dragons> {
		int x, y;

		public Dragons(int x, int y) {
			this.x = x;
			this.y = y;
		}

		public int compareTo(Dragons A) {
			if (x == A.x)
				return A.y - y;
			return x - A.x;
		}

		public String toString() {
			return x + " " + y;
		}
	}

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

	}

}