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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Cameron Pappas
 */
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) {
            int n = in.nextInt();
            int q = in.nextInt();
            int[] coinCount = new int[31];
            for (int i = 0; i < n; i++) {
                coinCount[(int) Math.floor(Math.log((double) in.nextInt()) / Math.log(2))]++;
            }
            for (int i = 0; i < q; i++) {
                int j = in.nextInt();
                int ans = 0;
                for (int a = 30; a >= 0 && j > 0; a--) {
                    int need = Math.min(j >> a, coinCount[a]);
                    ans += need;
                    j -= (1 << a) * need;
                }
                if (j > 0) {
                    ans = -1;
                }
                out.println(ans);
            }
        }

    }
}

