import java.util.*;
import java.io.*;
public class A
{
      public static void main(String ar[]) throws Exception
      {
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            int b[]=new int[31];
            int c[]=new int[31];
            
            b[0]=1;
            for(int i=1;i<31;i++)
             b[i]=b[i-1]*2;
            String s1[]=br.readLine().split(" ");
            int n=Integer.parseInt(s1[0]);
            int q=Integer.parseInt(s1[1]);
            
            String s2[]=br.readLine().split(" ");
            int a[]=new int[n];
            for(int i=0;i<n;i++)
            {
                  a[i]=Integer.parseInt(s2[i]);
                  int u=(int)(Math.log(a[i])/Math.log(2));
                  c[u]++;
            }
            
            for(int i=0;i<q;i++)
            {
                  int u=Integer.parseInt(br.readLine());
                  int t=0;
                  for(int j=30;j>=0;j--)
                  {
                        int x=u/b[j];
                        int v=Math.min(x,c[j]);
                        u-=v*b[j];
                        t+=v;
                  }
                  if(u>0)
                   System.out.println("-1");
                  else
                   System.out.println(t);
            }
      }
}