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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Harshal Khodifad
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(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, Scanner in, PrintWriter out) {
            long n = in.nextLong();
            long d = in.nextLong();

            long[] a = new long[(int) n];
            long[] b = new long[(int) d];

            long count[] = new long[31];
            count[0] = 0;
            long pow[] = new long[31];
            pow[0] = 1;

            HashMap<Long, Integer> map = new HashMap<>();
            map.put((long) 1, 0);

            for (int i = 1; i < 31; i++) {
                count[i] = 0;
                pow[i] = 2 * pow[i - 1];
                //out.println(pow[i]);
                map.put(pow[i], i);
            }

            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
                count[map.get(a[i])]++;
            }

            long c = 0;

            for (int i = 0; i < d; i++) {
                long x = in.nextLong();

                c = 0;

                for (int j = 30; j >= 0; j--) {
                    long req = x / pow[j];
                    if (req > count[j]) {
                        x -= pow[j] * count[j];
                        c += count[j];
                    } else {
                        x -= req * pow[j];
                        c += req;
                    }
                }

                if (x == 0) out.println(c);
                else out.println(-1);
            }


        }

    }
}

