import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * Created by dezhonger on 2018/7/8
 */
public class D {

    public static int log(int x) {
        String xx = Integer.toBinaryString(x);
        return xx.length() - 1;
    }

    static int max = 0;
    static Map<Integer, Integer> map = new HashMap<>();

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int q = scanner.nextInt();
        long sum = 0;
        int[] a = new int[1000];

        for (int i = 0; i < n; i++) {
            int t = scanner.nextInt();
            sum += t;
            t = log(t);

            a[t]++;
            max = Math.max(max, t);
        }
        for (int i = 0; i < q; i++) {
            int t = scanner.nextInt();
            if (t > sum) {
                System.out.println(-1);
            } else {
                Integer o = map.get(t);
                if (o!= null) {
                    System.out.println(o);
                } else {
                    int r = cal(a, t);
                    map.put(t, r);
                    System.out.println(r);
                }
            }

        }
    }

    private static int cal(int[] a, int t) {
        int count = 0;
        for (int i = max; i >= 0; i--) {
            if (t == 0) {
                break;
            }
            int x = 1 << (i);
            if (t >= x) {
                int k = t / x;
                k = Math.min(k, a[i]);
                t = t - k * x;
                count += k;
            }
            i = Math.min(i - 1, log(t));
        }
        return t == 0 ? count : -1;
    }
}
