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

public class File {
    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
            }

            return st.nextToken();
        }

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

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

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

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));


		
		
		
		int n = sc.nextInt();
		int q = sc.nextInt();
		
		
		
		Map<Integer, Integer> map = new HashMap();
		int max = 1;
		
		for (int i = 0; i < n; i++) {
			int val = sc.nextInt();
			map.put(val, map.getOrDefault(val, 0) + 1);			
			max = Math.max(max, val);
		}
		
		for (int j = 0; j < q; j++) {
			int b = sc.nextInt();			
			int coins = 0;
			
			
			for (int pow2 = max; pow2 >= 1 && b > 0; pow2 /= 2) {
				if (pow2 <= b && map.containsKey(pow2)) {					
					int mult = Math.min(b / pow2, map.get(pow2));
					b -= (mult*pow2);
					coins += mult;
				}
			}
			
			if (b == 0) {
				out.println(coins);
			}
			else {
				out.println(-1);
			}
		}
		
		
		
		out.close();
	}	
}











	