import java.util.Scanner;
import java.lang.Math;


public class Coins {

	public static void main(String[] args) {
		int i,j,k,l,q,num,left,start;
		Scanner sc = new Scanner(System.in);
		int coin = sc.nextInt();
		int querie = sc.nextInt();

		//int[] inputs = new int[]{2,4,8,2,4};

		int[] coins = new int[19];

		int[] queries = new int[querie];
		//int[] queries = new int[]{8,5,14,10};

		for(i=0; i<coin; i++){
			coins[(int) (Math.log(sc.nextInt())/Math.log(2))]++;
		}

		/*for(int m =0; m<coins.length; m++){
			System.out.print(m);
			System.out.print(": ");
			System.out.print(coins[m]);
			System.out.println();
		}*/

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

		for(k=0; k<queries.length; k++){
			num = 0;
			left = queries[k];
			start=coins.length-1;
			while(start>-1){
				if(left==0){
					System.out.println(num);
					break;
				}
				if(coins[start]==0){
					start--;
					continue;
				}
				//System.out.println(start);


				for(q=coins[start]; q>0; q--){
					if(Math.pow(2,start)<=left){
						num++;
						left -= Math.pow(2,start);
						/*System.out.print(start);
						System.out.print(" ");
						System.out.print(left);
						System.out.println();*/
					}
					else{
						break;
					}
				}
				start--;
			}

			if(left!=0){
				System.out.println(-1);
			}
		}
		sc.close();

	}

}
