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

public class Main {
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int j=in.nextInt();
		TreeMap<Integer,Integer> tm=new TreeMap<>();
		
		for(int i=0;i<n;i++) {
			int c=in.nextInt();
			if(tm.containsKey(c)) {
				int v=tm.get(c);
				tm.replace(c, v);
			}else tm.put(c, 1);
		}

		while(j-->0) {
			
			int q=in.nextInt(); 
			int ans=0;
			Iterator<Integer> it=tm.descendingKeySet().iterator();
			while(it.hasNext()) {
				int k=it.next();
				if(q>=k) {
					int r=q/k;
					int v=tm.get(k);
					if(r>v) {
						q -= v*k;
						ans += v;
					}else {
						q -= r*k;
						ans += r;
					}
				}
				if(q==0)break;
			}
			if(q==0) System.out.println(ans);
			else System.out.println(-1);
		}
		in.close();
	}
}