import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Set;
import java.util.HashMap;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.util.Map;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author \/
 */
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();
            List<Integer> cs = new ArrayList<>();
            Map<Integer, Integer> coins = new HashMap<>();
            for (int i = 0; i < n; i++) {
                int c = in.nextInt();
                if (!coins.keySet().contains(c)) {
                    cs.add(c);
                }
                coins.put(c, coins.getOrDefault(c, 0) + 1);
            }
            Collections.sort(cs);
            outerloop:
            while (q-- > 0) {
                int num = in.nextInt();
                int cnt = 0;
                for (int i = cs.size() - 1; i >= 0; i--) {
                    int coin = cs.get(i);
                    if (num >= coin) {
                        int nu = coins.get(cs.get(i));
                        int sub = Math.min(num / coin, nu);
                        num -= sub * coin;
                        cnt += sub;
                    }

                    if (num == 0) {
                        out.println(cnt);
                        continue outerloop;
                    }
                }
                out.println(-1);
            }
        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(s));
        }

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

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

    }
}

