import java.util.*;
import java.lang.*;
import java.io.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;

public class COINS_AND_QUERIES {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
	    FastReader s= new FastReader();
		int N = s.nextInt();
		int q = s.nextInt();
		
		HashMap<Integer,Integer> numbers = new HashMap<>();
		int max = Integer.MIN_VALUE;
		for(int i=0;i<N;i++) {
			int x = s.nextInt();
			if(max<x)
				max = x;
			if(numbers.containsKey(x)) {
				int count = numbers.get(x);
				numbers.put(x, count+1);
			}
			else
				numbers.put(x, 1);
		}
		for(int i=0;i<q;i++) {
			int x = s.nextInt();
			int count = 0;
			int val = max;
			//System.out.println("val="+val);
			while(val>0) {
				if(numbers.containsKey(val)&&val<=x) {
					
					int req = x/val;
					int av = numbers.get(val);
					if(av>=req) {
						count+=req;
						x = x-req*val;
					}
					else {
						count+=av;
						x = x-av*val;
					}
				}
				val = val/2;
				if(x==0)
					break;
			}
			if(x==0) {
				System.out.println(count);
			}
			else
				System.out.println(-1);
		}

	}
	
	 static class FastReader
	    {
	        BufferedReader br;
	        StringTokenizer st;
	 
	        public FastReader()
	        {
	            br = new BufferedReader(new
	                     InputStreamReader(System.in));
	        }
	 
	        String next()
	        {
	            while (st == null || !st.hasMoreElements())
	            {
	                try
	                {
	                    st = new StringTokenizer(br.readLine());
	                }
	                catch (IOException  e)
	                {
	                    e.printStackTrace();
	                }
	            }
	            return st.nextToken();
	        }
	 
	        int nextInt()
	        {
	            return Integer.parseInt(next());
	        }
	 
	        long nextLong()
	        {
	            return Long.parseLong(next());
	        }
	 
	        double nextDouble()
	        {
	            return Double.parseDouble(next());
	        }
	 
	        String nextLine()
	        {
	            String str = "";
	            try
	            {
	                str = br.readLine();
	            }
	            catch (IOException e)
	            {
	                e.printStackTrace();
	            }
	            return str;
	        }
	    }

}
