

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.TreeMap;

public class Coins {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String[] s=br.readLine().split(" ");
int n=Integer.parseInt(s[0]);TreeMap<Integer,Integer>map=new TreeMap<Integer,Integer>();
int q=Integer.parseInt(s[1]);
String s1[]=br.readLine().split(" ");
for(int i=0;i<n;i++)
	{int u=Integer.parseInt(s1[i]);
	map.put(u,map.getOrDefault(u,0)+1);
	}
ArrayList<Integer> list = new ArrayList<Integer>(map.keySet());
while(q-->0)
{int c=0;long f=0;
	int qr=Integer.parseInt(br.readLine());
	
	for(int i=list.size()-1;i>=0;)
	{int no=list.get(i);
		f=map.get(no);
		if(f*no<=qr)
		{
			qr-=f*no;
			c+=f;
			i--;
		}
		else 
			{if(no>qr)
			i--;
		else
		{
			long quo = qr/no;
            qr %= no;
            c += quo;
		}}
		if(qr==0)
			break;
	}
	if(qr==0)
		System.out.println(c);
	else
		System.out.println(-1);
	
	
}
	}

}
