import java.util.*;
import java.io.*;
public class B{
	static long n;
	public static void main(String[] args) {
		MyScanner scan = new MyScanner();
		PrintWriter pw = new PrintWriter(System.out);
		int n = scan.nextInt();
		int q = scan.nextInt();
		int range[] = new int[32];
		for(int i = 0;i < n;i++)
		{
			int a = scan.nextInt();
			int count = 0;
			while(a>1)
			{
				count++;
				a/=2;
			}
			range[count]++;
		}
		//System.out.println(Arrays.toString(range));
		int rev[] = new int[32];
		for(int i = 0;i < 32;i++)
			rev[i] = range[31-i];
		//range = rev.clone();
		//System.out.println(Arrays.toString(range));
		int carry = 0;
		for(int i = 0;i<32;i++)
		{
			range[i]+=carry/2;
			carry = range[i] - 1;
			if(carry < 0)
				carry = 0;
		}
		while(q-- > 0)
		{
			int num = scan.nextInt();
			String s = Integer.toBinaryString(num);
			int array[] = new int[32];
			int index = 0;
			for(int i = s.length() - 1;i >=0;i--)
				array[index++] = Integer.parseInt(s.charAt(i)+"");
			int count = 0;
			boolean exist = true;
			//System.out.println(Arrays.toString(array));
			for(int i = 0;i < 32;i++)
			{
				if(array[i] ==0)
					continue;
				if(array[i] !=0 && range[i] !=0)
					count++;
				else
				{
					exist = false;
					break;
				}
			}
			if(exist)
				pw.println(count);
			else
				pw.println(-1);
		}
		pw.close();
	}
}


//-------------------------------------------------------------------------------------------------------
class MyScanner {
    BufferedReader br;
    StringTokenizer st;

    public MyScanner() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    public int mod(long x) {
        // TODO Auto-generated method stub
        return (int) x % 1000000007;
    }

    public int mod(int x) {
        return x % 1000000007;
    }

    boolean hasNext() {
        if (st.hasMoreElements())
            return true;
        try {
            st = new StringTokenizer(br.readLine());
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st.hasMoreTokens();
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }

    public long nextLong() {
        return Long.parseLong(next());
    }
}	