import java.util.*;
import java.io.*;
public class Main {
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;
        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

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

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

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public boolean ready() throws IOException {
            return br.ready();
        }
    }
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);PrintWriter pw = new PrintWriter(System.out);
        int n=sc.nextInt(),q=sc.nextInt();int[] a = new int[n];int[] cnt = new int[31];
        for (int i=0;i<n;i++){ a[i]=sc.nextInt();int j=0;while (((a[i]>>j)&1)!=1)j++;cnt[j]++; }
        for (int i=0;i<q;i++){
            int x=sc.nextInt(),ans=0;
            for (int k=30;k>=0&&x>0;k--){ int nd = Math.min(cnt[k],x>>k);ans+=nd;x-=(1<<k)*nd; }
            if (x>0)ans=-1;System.out.println(ans);
        }
    }
}