
import java.util.Map;
import java.util.Scanner;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
import javafx.collections.transformation.SortedList;

public class D {

    public static void main(String args[]) {
        new D().run();
    }

    SortedSet<Integer> ss = new TreeSet<>();
    Integer ss2[];

    int szam(Map<Integer, Integer> m, int szam) {
        int ret = 0;
        for (int i = ss2.length - 1; i >= 0; i--) {
            if (szam / ss2[i] > m.get(ss2[i])) {
                ret += m.get(ss2[i]);
                szam -= ss2[i] * m.get(ss2[i]);
            } else {
                ret += szam / ss2[i];
                szam %= ss2[i];
            }
        }
        if (ret > 0 && szam == 0) {
            return ret;
        }
        return -1;
    }

    void run() {
        Scanner s = new Scanner(System.in);
        Map<Integer, Integer> m = new TreeMap<>();
        int n = s.nextInt(), q = s.nextInt();
        for (int i = 0; i < n; i++) {
            int in = s.nextInt();
            if (m.containsKey(in)) {
                m.put(in, m.get(in) + 1);
            }
            m.put(in, 1);
            ss.add(in);
        }
        ss2 = new Integer[ss.size()];
        ss2 = ss.toArray(ss2);
        for (int i = 0; i < q; i++) {
            int in = s.nextInt();
            System.out.println(szam(m, in));
        }

    }
}
