import java.util.*;
public class Coins_and_Queries {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int q = in.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = Integer.MAX_VALUE;
        }
        int[] freq = new int[31];
        int[] freq2 = new int[31];
        int temp, x, k = 0;
        for (int i = 0; i < n; i++) {
            x = in.nextInt();
            temp = (int) (Math.log(x)/Math.log(2));
            if(freq[temp] == 0)
                arr[k++] = x;
            freq[temp]++;
        }
        Arrays.sort(arr);
        int b, ans;
        for (int i = 0; i < q; i++) {
            ans = 0;
            b = in.nextInt();
            if(b % 2 == 1){
                System.out.println("-1");
            }
            else{
                for (int j = 0; j < freq.length; j++) {
                    freq2[j] = freq[j];
                }
                int pos = 1;
                while(pos != 0){
                    pos = Arrays.binarySearch(arr, b);
                    if(pos >= 0){
                        ans++;
                        break;
                    }
                    pos *= -1;
                    pos -= 2;
                    if(pos == -1){
                        ans = -1;
                        break;
                    }
                    temp = (int) (Math.log(arr[pos])/Math.log(2));
                    if(freq2[temp] > 0){
                        ans++;
                        b = b-arr[pos];
                        freq2[temp]--;
                    }
                    else{
                        ans = -1;
                        break;
                    }
                }
                System.out.println(ans);
            }
        }
    }
}
