import java.util.*;
import java.io.*;
import java.lang.Math;

public final class ProblemD {
    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());

        int n = Integer.parseInt(st.nextToken());
		int q = Integer.parseInt(st.nextToken());
		st = new StringTokenizer(br.readLine());
        

        int[] arr = new int[n];

        int[] powers = new int[31];
        for (int p = 30 ; p >= 0 ; p--) {
            int el = (int)Math.pow(2, p);
            powers[p]= el;
        }
        

        HashMap<Integer, Integer> map = new HashMap();

        for (int i = 0 ; i < n ; i++) {
			arr[i] = Integer.parseInt(st.nextToken());
            
            int occ = map.getOrDefault(arr[i], 0);
            occ++;
            map.put(arr[i], occ);
        }

        for (int i = 0 ; i < q ; i++) {
			int query = Integer.parseInt(br.readLine());
            

            int ans = 0;
            for (int p = 30 ; p >= 0 ; p--) {
                int el = powers[p];

                int mult = Math.min(query/el, map.getOrDefault(el , 0));
                query -= mult * el;
                ans += mult;
                if (query == 0) {
                    break;
                }
            }

            if (query > 0) {
                System.out.println(-1);
            } else {
                System.out.println(ans);
            }
        }
    }
}
