import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Solve6 {

    public static void main(String[] args) {
        PrintWriter pw = new PrintWriter(System.out);
        new Solve6().solve(pw);
        pw.flush();
        pw.close();
    }

    public void solve(PrintWriter pw) {
        FastReader sc = new FastReader();
        int n = sc.nextInt(), q = sc.nextInt();
        int[] freq = new int[31];
        for (int i = 0; i < n; i++) {
            int x = (int) (Math.log(sc.nextInt()) / Math.log(2));
            ++freq[x];
        }
        while (q-- > 0) {
            int b = sc.nextInt();
            int cnt = 0;
            int ans = 0;
            for (int i = 31; i >= 0; i--, cnt *= 2) {
                if ((b & (1 << i)) != 0) {
                    ++cnt;
                }
                if (cnt > 0) {
                    ans += Math.min(cnt, freq[i]);
                    cnt = Math.max(cnt - freq[i], 0);
                }
            }
            pw.println((cnt == 0 ? ans : -1));
        }
    }

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
            }
        }

        public String next() {
            if (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public boolean hasNext() throws IOException {
            if (st != null && st.hasMoreTokens()) {
                return true;
            }
            String s = br.readLine();
            if (s == null || s.isEmpty()) {
                return false;
            }
            st = new StringTokenizer(s);
            return true;
        }
    }
}
