import java.util.Scanner;
import java.util.Arrays;


public class Coins {

	public static void main(String[] args) {
		int i,j,k,l,num,left;
		Scanner sc = new Scanner(System.in);
		int coin = sc.nextInt();
		int querie = sc.nextInt();
		int[] coins = new int[coin];
		int[] queries = new int[querie];
		for(i=0; i<coin; i++){
			coins[i] = sc.nextInt();
		}

		for(j=0; j<querie; j++){
			queries[j] = sc.nextInt();
		}

		Arrays.sort(coins);
		for(k=0; k<queries.length; k++){
			num = 0;
			left = queries[k];
			for(l=coins.length-1; l>=0; l--){
				if(left==0){
					System.out.println(num);
				}
				if(coins[l]<left){
					num++;
					left -= coins[l];
				}
			}
			if(left!=0){
				System.out.println(-1);
			}
		}
		sc.close();
	}

}
