import java.io.IOException;
import java.io.InputStream;
import java.util.*;

public class Main {
	
	static boolean check(int[] T,long num) {
		int ind = (int)(Math.log(num)/Math.log(2));
		for(int i=ind-1;i>=0;i++) {			
			if(T[i] >= 2) {
				T[i] -= 2;
				return true;
			}else {
				return check(T,num-(long)(Math.pow(2,T[i])));
			}
		}
		return false;
	}
	
	static void debug(Object... O) {
		System.out.println(Arrays.deepToString(O));
	}
	
	static class InputReader {
		 
		private InputStream stream;
		private byte[] buf = new byte[8192];
		private int curChar;
		private int snumChars;
		private SpaceCharFilter filter;
 
		public InputReader(InputStream stream) {
			this.stream = stream;
		}
 
		public int snext() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
 
		public int nextInt() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
 
			int res = 0;
 
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
 
			return res * sgn;
		}
		
		public long nextLong() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
 
			long res = 0;
 
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
 
			return res * sgn;
		}
		
		public String readString() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}
 
		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
 
		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
	
	public static void main(String[] args) {
		//Scanner sc = new Scanner(System.in);
		InputReader sc = new InputReader(System.in);
		long n = sc.nextLong();
		long q = sc.nextLong();
		int[] N = new int[33];
		
		for(int i=0;i<n;i++) {
			long num = sc.nextLong();
			int ind = (int)(Math.log(num)/Math.log(2));
			N[ind]++;
		}
		StringBuilder sb = new StringBuilder(); 
		while(q-- > 0) {
			long b = sc.nextLong();
			int coins = 0;
			for(int i=32;i>=0;i--) {
				int temp = (int)Math.min(N[i],(b/(1<<i)));
				coins += temp;
				b -= temp*(1<<i);
			}
			if(b != 0) {
				sb.append("-1");
				sb.append('\n');
			}else {
				sb.append(coins);
				sb.append('\n');
			}					
		}
		System.out.println(sb);
	}

}
