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

public class Coins_and_Queries {

    public static void main(String[] args) throws IOException {
        Scan in = new Scan();
        int n = in.nextInt();
        int q = in.nextInt();
        int[] freq = new int[32];
        int temp, x;
        for (int i = 0; i < n; i++) {
            x = in.nextInt();
            temp = (int) (Math.log(x) / Math.log(2));
            freq[temp]++;
        }
        int b, ans;
        for (int i = 0; i < q; i++) {
            ans = 0;
            b = in.nextInt();
            int div, min, start = (int) (Math.log(b) / Math.log(2));
            for (int j = start; j >= 0; j--) {
                temp = (int) (Math.pow(2, j));
                div = b / temp;
                min = Math.min(div, freq[j]);
                ans += min;
                b -= (min * temp);
            }
            if (b == 0) {
                System.out.println(ans);
            } else {
                System.out.println("-1");
            }

        }
    }

    static class Scan {

        public java.io.InputStream stream = System.in;
        private final static byte EOF = -1, NL = '\n', D = '-', SPC = ' ', buffer[] = new byte[0xFFFF];
        private char cBuff[] = new char[0xFF];
        public int $index, $readCount, itr;

        private void inc() {
            cBuff = java.util.Arrays.copyOf(cBuff, cBuff.length << 1);
        }

        private boolean readLINE() throws IOException {
            if ($readCount == EOF) {
                return false;
            }
            for (itr = 0;;) {
                while ($index < $readCount) {
                    if (buffer[$index] != NL) {
                        if (itr == cBuff.length) {
                            inc();
                        }
                        cBuff[itr++] = (char) buffer[$index++];
                    } else {
                        $index++;
                        return true;
                    }
                }
                $index = 0;
                $readCount = stream.read(buffer);
                if ($readCount == EOF) {
                    return true;
                }
            }
        }

        private boolean readPRT() throws IOException {
            if ($readCount == EOF) {
                return false;
            }
            T:
            for (;;) {
                while ($index < $readCount) {
                    if (buffer[$index] > SPC) {
                        break T;
                    } else {
                        $index++;
                    }
                }
                $index = 0;
                $readCount = stream.read(buffer);
                if ($readCount == EOF) {
                    return false;
                }
            }
            for (itr = 0;;) {
                while ($index < $readCount) {
                    if (buffer[$index] > SPC) {
                        if (itr == cBuff.length) {
                            inc();
                        }
                        cBuff[itr++] = (char) buffer[$index++];
                    } else {
                        return true;
                    }
                }
                $index = 0;
                $readCount = stream.read(buffer);
                if ($readCount == EOF) {
                    return true;
                }
            }
        }

        public int nextInt() throws IOException {
            if (!readPRT()) {
                throw new IOException();
            } else {
                int v = 0, i = 0;
                boolean neg;
                if (cBuff[i] == D) {
                    neg = true;
                    i++;
                } else {
                    neg = false;
                }
                while (i < itr) {
                    v = (v << 3) + (v << 1) + cBuff[i++] - '0';
                }
                return neg ? -v : v;
            }
        }

        public long nextLong() throws IOException {
            if (!readPRT()) {
                throw new IOException();
            } else {
                long v = 0;
                int i = 0;
                boolean neg;
                if (cBuff[i] == D) {
                    neg = true;
                    i++;
                } else {
                    neg = false;
                }
                while (i < itr) {
                    v = (v << 3L) + (v << 1L) + cBuff[i++] - '0';
                }
                return neg ? -v : v;
            }
        }

        public char[] buffer() throws IOException {
            return readPRT() ? cBuff : null;
        }

        public String next() throws IOException {
            return readPRT() ? new String(cBuff, 0, itr) : null;
        }

        public char[] nextArr() throws IOException {
            return readPRT() ? java.util.Arrays.copyOf(cBuff, itr) : null;
        }

        public String nextLine() throws IOException {
            return readLINE() ? new String(cBuff, 0, itr) : null;
        }

        public char[] nextLineArr() throws IOException {
            return readLINE() ? java.util.Arrays.copyOf(cBuff, itr) : null;
        }

        public float nextFloat() throws IOException {
            return Float.parseFloat(next());
        }

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