import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author kanak893
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public void solve(int testNumber, InputReader fi, PrintWriter out) {
            int n, q, i, j, k;
            n = fi.nextInt();
            q = fi.nextInt();
            HashMap<Integer, Integer> hm = new HashMap<>();
            for (i = 0; i < n; i++) {
                int x = fi.nextInt();
                if (hm.containsKey(x)) {
                    hm.put(x, hm.get(x) + 1);
                } else hm.put(x, 1);
            }
            int power2[] = new int[32];
            power2[0] = 1;
            for (i = 1; i < 32; i++) {
                power2[i] = 2 * power2[i - 1];
            }
            while (q-- > 0) {
                int x = fi.nextInt();
                int ans = 0;
                for (i = 31; i >= 0; i--) {
                    int s = power2[i];
                    if (hm.containsKey(s)) {
                        k = hm.get(s);
                        int w = x / s;
                        int e = Math.min(k, w);
                        x = x - e * s;
                        ans = ans + e;
                    }
                }
                if (x == 0) {
                    out.println(ans);
                } else out.println("-1");


            }
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int snumChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

