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

public final class ProblemA {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int q = sc.nextInt();
        int[] arr = new int[n];

        HashMap<Integer, Integer> powerMap = new HashMap();
        for (int p = 31 ; p >= 0 ; p--) {
            int el = (int)Math.pow(2, p);
            powerMap.put(p, el);
        }
        

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

        for (int i = 0 ; i < n ; i++) {
            arr[i] = sc.nextInt();
            int occ = map.getOrDefault(arr[i], 0);
            occ++;
            map.put(arr[i], occ);
        }
        for (int i = 0 ; i < q ; i++) {
            int query = sc.nextInt();
            int occ = map.getOrDefault(arr[i], 0);

            int ans = 0;
            for (int p = 31 ; p >= 0 ; p--) {
                int el = powerMap.get(p);
                int mult = Math.min(query/el, map.getOrDefault(el,0));
                if (mult > 0) {
                    query -= mult * el;
                    ans += 1;
                }
            }

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