import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int q = scanner.nextInt();
        int a[] = new int[200001];
        for (int i = 0; i < n; i++) {
            a[scanner.nextInt()]++;
        }
        for (int i = 0; i < q; i++) {
            int c = scanner.nextInt();
            int cnt = 0;
            int ans = 0;
            for (int j = 30; j >= 0; j--) {
                if((c & (1<<j)) != 0) {
                    cnt++;
                    if((1<<j) <= 2000000 && a[1<<j] > 0) {
                        ans = ans + Math.min(cnt, a[1<<j]);
                        cnt = cnt > a[1<<j] ? cnt - a[1<<j] : 0;
                    } else {
                        cnt *= 2;
                    }
                }
            }
            if(cnt == 0) {
                System.out.println(ans);
            } else {
                System.out.println(-1);
            }
        }
    }
}
