import java.io.*;
import java.util.*;

public class Main2 {

    int arr[];

    public void solve(){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int q = in.nextInt();
        arr = new int[32];
        for (int i = 0; i < n; i++) {
            int key = in.nextInt();
            arr[log2(key) + 1] ++;
        }
        for (int i = 0; i < q; i++) {
            int val = in.nextInt();
            int ans =checkVal(val);
            System.out.println(ans);
        }

    }

    static int log2(int x) {
        int res = 0;
        while ((x >>= 1) != 0)
            res++;
        return res;
    }

    private int checkVal(int val) {
        int counter = 0;
        //counter += Math.min(val/entry.getKey(),temp);
        //val -= Math.min(val/entry.getKey(),temp) * entry.getKey();
        for(int i = 31;i >= 0;i--){
            int digit = (1 << (i - 1));
            if (val >= digit && arr[i] > 0){
                counter += Math.min(val/digit,arr[i]);
                val -=  Math.min(val/digit,arr[i]) * digit;
            }
        }
        return val==0?counter:-1;
    }

    public static void main(String args[]) {
        new Main2().solve();
    }
}