import java.io.*;
import java.util.*;
import java.math.BigInteger;
import java.math.BigDecimal;
 
public class problem494_D {
   
    static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    
    void solve() throws IOException {
        long n = readLong();
        long q = readLong();
        HashMap<Long, Long> map = new HashMap<Long, Long>();
        HashMap<Long, Long> num = new HashMap<Long, Long>();
        
        
        for (int i = 0; i < n; ++i) {
        	long a = readLong();
        	if (!map.containsKey(a)) {
        		map.put(a, 1L);
        	} else {
        		map.put(a, map.get(a)+1);
        	}
        }
        
        for (int i = 0; i <= 30; ++i) {
        	if (!map.containsKey((long)(1 << i))) {
        		map.put((long)1<<i, 0L);
        	}
        }
        
        for (int j = 0; j < q; ++j) {
        	long next = readLong();
        	long cur = 0;
        	long c = 0;
        	for (int i = 30; i >= 0 && next > 0; --i) {
        		cur = min(next/(1<<i), map.get((long)(1<<i)));
        		if (cur > 0) {
        			next -= (long)(cur*(1<<i));
        			c += cur;
        		}
        	}
        	if (next == 0) {
        		out.println(c);
        	} else {
        		out.println(-1);
        	}
        }
    }
        
////////// Methods ///////////////////////////////////////////////////////////////////////////    

    int min(int... a) {
    	int min = Integer.MAX_VALUE;
    	
    	for (int i = 0; i < a.length; ++i) {
    		if (min > a[i]) {
    			min = a[i];
    		}
    	}
    	
    	return min;
    }
    
    int max(int... a) {
    	int max = Integer.MIN_VALUE;
    	
    	for (int i = 0; i < a.length; ++i) {
    		if (max < a[i]) {
    			max = a[i];
    		}
    	}
    	
    	return max;
    }
    
    long min(long... a) {
    	long min = Long.MAX_VALUE;
    	
    	for (int i = 0; i < a.length; ++i) {
    		if (min > a[i]) {
    			min = a[i];
    		}
    	}
    	
    	return min;
    }
    
//////// #Methods //////////////////////////////////////////////////////////////////////////////////////////////////
    
/////// Classes //////////////////////////////////////////////////////////////////////////////////////////////////////////
    
    class Pair implements Comparable<Pair> {
    	long x;
    	long y;
    	
    	Pair() {
    		this.x = 0;
    		this.y = 0;
    	}
    	
    	Pair(long x, long y) {
    		this.x = x;
    		this.y = y;
    	}
    	
    	@Override
    	public boolean equals(Object obj) {
    		if (this == obj) {
    			return true;
    		}
    		if (obj == null) return false;
    		Pair other = (Pair) obj;
    		if (this.x == other.x && this.y == other.y) {
    			return true;
    		}
    		return false;
    	}
    	
    	@Override
    	public int compareTo(Pair other) {
    		if (this.x != other.x) return Long.compare(this.x, other.x);
    		return Long.compare(this.y*other.x, this.x*other.y);
    	}
    }
    
////// #Classes ////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
/////// Initialization ////////////////////////////////////////////////////////////////////////////////////////////////////////
    
    public static void main(String[] args) {
        new problem494_D().run();
    }
   
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok;
   
    void init() throws FileNotFoundException {
      
        if (ONLINE_JUDGE) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("D:\\Java-programs\\eclipse-workspace\\OLYMP\\src\\input.txt"));
            out = new PrintWriter("D:\\Java-programs\\eclipse-workspace\\OLYMP\\src\\output.txt");
        }
       
        tok = new StringTokenizer("");
    }
   
    void run() {
        try {
            long timeStart = System.currentTimeMillis();
           
            init();
            solve();
           
            out.close();
           
            long timeEnd = System.currentTimeMillis();
            System.err.println("Time = " + (timeEnd - timeStart));
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }
   
    String readLine() throws IOException {
        return in.readLine();
    }
   
    String delimiter = " ";
   
    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (null == nextLine) return null;
           
            tok = new StringTokenizer(nextLine);
        }
       
        return tok.nextToken(delimiter);
    }
   
    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }
   
    long readLong() throws IOException {
        return Long.parseLong(readString());
    }
    
    double readDouble() throws IOException {
    	return Double.parseDouble(readString());
    }       
}

////////// #Initialization //////////////////////////////////////////////////////////////////////////////////////