// package cf1003;

import java.io.BufferedInputStream;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    static Scanner in = new Scanner(new BufferedInputStream(System.in));
    static int nums[] = new int[35];
    static public void main(String argv[]){
        while(in.hasNext()){
            int n = in.nextInt();
            int q = in.nextInt();
            for(int i=1;i<=n;i++){
                long num = in.nextLong();
//                System.out.println(quick_multi((int)num));
                int index = (int)(Math.log((double)num)/Math.log(2d));
                nums[index]++;
            }
            for(int i=0;i<q;i++){
                int ans = 0;
                long query = in.nextLong();
                for(int j=32;j>=0;j--){
                    if(query==0) break;
                    if(nums[j]==0) continue;
//                    System.out.println(j+" "+nums[j]);
                    long mo = 1<<j;
                    if(query>=mo){
                        long need = query/mo;
                        if(nums[j]<need){
                            ans+=nums[j];
                            query-=nums[j]*mo;
                        }else{
                            ans+=need;
                            query-=need*mo;
                        }
                    }
//                    System.out.println(j+" "+query+" "+ans);
                }
                if(query!=0){
                    System.out.println(-1);
                }else{
                    System.out.println(ans);
                }
            }
        }
    }

}
