import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class DCoinsAndQueries {
        public void solve(int testNumber, inputClass sc, PrintWriter out) {
            int[] puis = new int[31];
            int n = sc.nextInt();
            int q = sc.nextInt();
            for (int i = 0; i < n; i++) {
                int x = sc.nextInt();
                for (int j = 0; j < 31; j++) {
                    if (x == (1 << j)) {
                        puis[j]++;
                        break;
                    }
                }
            }
            int a;
            for (int i = 0; i < q; i++) {
                a = sc.nextInt();
                int to = 0;
                for (int j = 30; j >= 0; j--) {
                    to += Math.min(puis[j], a / (1 << j));
                    a -= Math.min(puis[j], a / (1 << j)) * (1 << j);

                }
                if (a == 0) {
                    out.println(to);
                } else {
                    out.println(-1);
                }
            }

        }

    }

    static class inputClass {
        BufferedReader br;
        StringTokenizer st;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

    }
}

