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

public class Main {

    public static void main(String[] args) {

        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {

            String[] line = reader.readLine().split(" ");
            int n = Integer.parseInt(line[0]);
            int q = Integer.parseInt(line[1]);

            line = reader.readLine().split(" ");
            int[] a = new int[40];
            for(int i = 0; i < n; i++) {
                a[log(Integer.parseInt(line[i]), 2)]++;
            }

            for(int i = 0; i < q; i++) {
                int num = Integer.parseInt(reader.readLine());
                char[] chars = Integer.toBinaryString(num).toCharArray();
                int deg = chars.length - 1;
                int count = 0;
                int ans = 0;
                for(int c = 0; c < chars.length; c++) {
                    count += chars[c] - '0';
                    //println("C " + count);
                    ans += Math.min(a[deg], count);
                    count = Math.max(0, count - a[deg]);
                    deg--;
                    count *= 2;
                }
                if(count > 0) {
                    println(-1);
                } else {
                    println(ans);
                }
            }

        } catch (IOException e) {
        }
    }

    static int log(int num, int d) {
        int ans = 0;
        while(num > 1) {
            num /= d;
            ans++;
        }
        return ans;
    }

    static class Pair implements Comparable<Pair> {
        int a, b;
        Pair(int a, int b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public int compareTo(Pair o) {
            if(this.a > o.a) {
                return 1;
            } else if(this.a < o.a) {
                return -1;
            }
            return 0;
        }
    }

    static String reverse(String s) {
        String ans = "";
        char[] c = s.toCharArray();
        for(int i = s.length() - 1; i >= 0; i--) {
            ans += c[i];
        }
        return ans;
    }

    static long fac(int deg) {
        long ans = 1;
        for(int i = 2; i <= deg; i++) {
            ans *= i;
        }
        return ans;
    }

    static int r(int a, int b) {
        int ans = a / b;
        if(a % b != 0)
            ans++;
        return ans;
    }

    static void print(Object o) {
        System.out.print(o.toString());
    }

    static void println(Object o) {
        System.out.println(o.toString());
    }
}
