
import java.io.*;
import java.math.BigInteger;
import java.util.*;



public class Main {

    static int MAX = 32;
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
        /*
        int n      = sc.nextInt();        // read input as integer
        long k     = sc.nextLong();       // read input as long
        double d   = sc.nextDouble();     // read input as double
        String str = sc.next();           // read input as String
        String s   = sc.nextLine();       // read whole line as String
        */

        int n = sc.nextInt();
        int q = sc.nextInt();
        int [] ns = new int[MAX];
        int [] qs = new int[q];
        BigInteger sum = new BigInteger("0");
        for (int i = 0; i < n; i++) {
            int df = sc.nextInt();
            sum = sum.add(BigInteger.valueOf(df));
            int pos = Math.getExponent(df);
            ns[pos]++;
        }
        for (int i = 0; i < q; i++) {
            qs[i] = sc.nextInt();
        }
        Map<Integer, Integer> map = new HashMap<>();
        for (int qq : qs) {
            if (sum.compareTo(BigInteger.valueOf(qq)) < 0) {
                out.println(-1);
            } else {
                out.println(find(qq, ns, map));
            }
        }


        // Stop writing your solution here. -------------------------------------
        out.close();
    }

    private static int find(int q, int[] ns, Map<Integer, Integer> map) {
//        System.out.println("------------------------");
//        print(ns, map);
//        System.out.println("q = " + q + " next=" + next);
        Stack<Integer> stack = new Stack<>();
        int cached = 0;
        label:
        while (q > 0) {
//            System.out.println("q = " + q + " next=" + next);
//            print(ns, map);
            if (map.containsKey(q) && map.get(q) > 0) {
                cached = map.get(q);
                break;
            }
            if (!map.containsKey(q)) {
                for (int i = MAX -1; i >= 0; i--) {
                    if (ns[i] > 0) {
                        int e = (int) Math.pow(2, i);
                        if (e <= q) {
                            stack.push(i);
                            ns[i]--;
//                            System.out.println(e + " " + q);
                            q -= e;
//                            System.out.println("cont " + q);
                            continue label;
                        }
                    }
                }
            }
            map.put(q, -1);
            while (!stack.isEmpty()) {
                int n = stack.pop();
                ns[n]++;
                q += Math.pow(2, n);
                map.put(q, -1);
            }
            return -1;

        }
        int res = stack.size() + cached;
//        System.out.println("res = " + res);
        while (!stack.isEmpty()) {
            int n = stack.pop();
            ns[n]++;
            q += Math.pow(2, n);
            cached ++;
            map.put(q, cached);
        }

        return res;
    }

    public static void print(int [] n, Map m) {
//        for (int i : n) {
//            System.out.print(i + " ");
//        }
        System.out.println();
        System.out.println(m);
    }




    //-----------PrintWriter for faster output---------------------------------
    public static PrintWriter out;

    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

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

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

        long nextLong() {
            return Long.parseLong(next());
        }

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
//--------------------------------------------------------
}