import java.util.Scanner;
import java.util.TreeMap;

public class CF1003D {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int q = sc.nextInt();
		TreeMap<Integer, Integer> map = new TreeMap<>();
		while(n-->0) {
			int x = sc.nextInt();
			map.put(x, map.containsKey(x) ? map.get(x)+1 : 1);
		}
		while(q-->0) {
			int x = sc.nextInt();
			int total = 0;
			while(x>0) {
				Integer index = map.floorKey(x);
				if(index==null) break;
				total+=x/index;
				x%=index;
			}
			System.out.println(x==0 ? total : "-1");
		}
	}
}
