import java.util.*;
import java.io.*;
public class Main {
 
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
	    int n = Integer.parseInt(st.nextToken());
	    int k = Integer.parseInt(st.nextToken());
        int[] arr = new int[n];
        HashMap<Integer, Integer> map = new HashMap<>();
                    st = new StringTokenizer(br.readLine());
        for (int i = 0; i < n; i++) {
            int x = Integer.parseInt(st.nextToken());
            arr[i] = x;
            if (!map.containsKey(x)) {
                map.put(x, 1);
            } else {
                map.replace(x, map.get(x) + 1);
            }
        }List<Integer> hl = new ArrayList<>(map.keySet());
	    for(int j =0; j<k; j++){
	       st = new StringTokenizer(br.readLine());
	       int m = Integer.parseInt(st.nextToken());
               int ans =0;
        ArrayList<Integer> list = new ArrayList<Integer>(hl); 
        Collections.sort(list);
//System.out.println(list.get(0));System.out.println(list.get(1));System.out.println(list.get(2));
               while(m>0 &&!list.isEmpty()){
                   int min = Math.min(m/list.get(list.size()-1),map.get(list.get(list.size()-1)));
                   m= m-list.get(list.size()-1)*min;
                   ans +=min;
                  // System.out.println(list.get(list.size()-1));
                   list.remove(list.size()-1);
               }
               if(m==0) System.out.println(ans);
               else System.out.println(-1);
           }
	}}