import java.io.*;
import java.util.*;

public class Main {

	static class PairComparator implements Comparator<Pair> {
		@Override
		public int compare(Pair x, Pair y) {
			if (x.val < y.val)
				return -1;
			if (x.val > y.val)
				return 1;
			if (x.val == y.val) {
				if (x.ind < y.ind)
					return -1;
				if (x.ind > y.ind)
					return 1;
			}
			return 0;
		}
	}

	static class Pair {
		int ind, val;

		Pair(int i, int v) {
			ind = i;
			val = v;
		}
	}

	static int[] vis;

	static long sum=0;
	static boolean dfs(int curr, List<Integer >[] tree, int minV, int[] p){
		if (p[curr]==-1){
			int minCurr = Integer.MAX_VALUE;
			for (int i=0;i<tree[curr].size();i++){
				minCurr = Math.min(minCurr, p[tree[curr].get(i)]);	
			}
			p[curr] = minCurr;
		}
		if (p[curr]<minV)return false;
		if (p[curr]!=Integer.MAX_VALUE)sum+=p[curr] - minV;
		for (int i=0;i<tree[curr].size();i++){

			if (!dfs(tree[curr].get(i), tree, p[curr]==-1?minV:p[curr], p)){
				return false;
			}	
		}
		return true;

	}

	static void func() throws Exception {
		int n , q;
		n = sc.nextInt();
		q = sc.nextInt();
		int[] arr = new int[33];
		for (int i=0;i<n;i++){
			int v = sc.nextInt();
			int cnt=0;
			while (v!=1){
				v/=2;
				cnt++;
			}
			arr[cnt]++;
		}
		for (int i=0;i<q;i++){
			int val = sc.nextInt();
			long curr = 1;
			for (int j=0;j<30;j++){
				curr*=2;
			}
			int coins = 0;
			for (int j=30;j>=0;j--){
				if (curr<=val && arr[j]>0){
					long use = Math.min(val/curr, arr[j] );
					coins+=use;
					val -= use*curr;
				}
				curr/=2;
				if (val==0)break;
			}
			if (val>0)pw.println(-1);
			else pw.println(coins);

			pw.flush();
		}
		
		
	}

	/*
	 
	 * */
	static PrintWriter pw;
	static MScanner sc;

	public static void main(String[] args) throws Exception {

		pw = new PrintWriter(System.out);
		sc = new MScanner(System.in);

		int tests = 1;
	//	tests =sc.nextInt(); //comment this line
		while (tests-- > 0) {
			func();
			pw.flush();
		}

	}

	static class MScanner {
		StringTokenizer st;
		BufferedReader br;

		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int[] intArr(int n) throws IOException {
			int[] in = new int[n];
			for (int i = 0; i < n; i++)
				in[i] = nextInt();
			return in;
		}

		public long[] longArr(int n) throws IOException {
			long[] in = new long[n];
			for (int i = 0; i < n; i++)
				in[i] = nextLong();
			return in;
		}

		public int[] intSortedArr(int n) throws IOException {
			int[] in = new int[n];
			for (int i = 0; i < n; i++)
				in[i] = nextInt();
			shuffle(in);
			Arrays.sort(in);
			return in;
		}

		public long[] longSortedArr(int n) throws IOException {
			long[] in = new long[n];
			for (int i = 0; i < n; i++)
				in[i] = nextLong();
			shuffle(in);
			Arrays.sort(in);
			return in;
		}

		public Integer[] IntegerArr(int n) throws IOException {
			Integer[] in = new Integer[n];
			for (int i = 0; i < n; i++)
				in[i] = nextInt();
			return in;
		}

		public Long[] LongArr(int n) throws IOException {
			Long[] in = new Long[n];
			for (int i = 0; i < n; i++)
				in[i] = nextLong();
			return in;
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

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

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

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

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

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}

	static void shuffle(int[] in) {
		for (int i = 0; i < in.length; i++) {
			int idx = (int) (Math.random() * (i + 1));
			int tmp = in[i];
			in[i] = in[idx];
			in[idx] = tmp;
		}
	}

	static void shuffle(long[] in) {
		for (int i = 0; i < in.length; i++) {
			int idx = (int) (Math.random() * (i + 1));
			long tmp = in[i];
			in[i] = in[idx];
			in[idx] = tmp;
		}
	}
}
