import java.io.*;
import java.math.BigInteger;
import java.util.*;


public class Main {
	public static void main(String[] args) throws IOException {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		PrintWriter out = new PrintWriter(outputStream);
		InputReader in = new InputReader(inputStream);
		//InputStream uinputStream = new FileInputStream("milkorder.in");
		//InputReader in = new InputReader(uinputStream);
		//PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("milkorder.out")));
		Task t = new Task();
		t.solve(in, out);
		out.close();
	}

	static class Task {
		
		class TreeNode {
			 int val;
			 TreeNode left;
			 TreeNode right;
			 TreeNode(int x) { val = x; }
		}
		public class ListNode {
			int val;
			ListNode next;
			ListNode(int x) { val = x; }
		}		
		public void solve(InputReader in, PrintWriter out) throws IOException {
//			long tStart = System.currentTimeMillis();
			int n = in.nextInt();
			int k = in.nextInt();
			int arr[] = new int[33];
			for(int i=0;i<n;i++){
				int t = in.nextInt();
				int p=0;
				while(t>=2){
					t/=2;
					p++;
				}
				arr[p]++;
			}
			//Dumper.print_int_arr(arr);
			for(int i=0;i<k;i++){
				int tmp[] = arr.clone();
				int t = in.nextInt();
				int p = 32; int c=0;
				while(p>=0){
					int v = (int)Math.pow(2, p);
					if(t>=Math.pow(2, p)&&tmp[p]>0){
						int v1 = t/v;
						if(tmp[p]>=v1){
							t-=v*v1;
							c+=v1;
						}else{
							t-=v*tmp[p];
							c+=tmp[p];
						}
					}else{
						p--;
					}
				}
				if(c==0||t!=0) out.println(-1);
				else out.println(c);
			}
		}
	}

	// default class
	static class InputReader {
		public BufferedReader re;
		public StringTokenizer st;

		public InputReader(InputStream input) {
			re = new BufferedReader(new InputStreamReader(input));
			st = null;
		}

		public String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(re.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return st.nextToken();
		}

		public String nextLine() {
			String tmp = null;
			try {
				tmp = re.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
			return tmp;
		}

		public boolean hasNext() {
			String tmp;
			if (st != null && st.hasMoreTokens())
				return true;
			else {
				try {
					tmp = re.readLine();
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				if (tmp != null) {
					st = new StringTokenizer(tmp);
					return true;
				} else {
					return false;
				}
			}
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}
	}

	static class Dumper {
		static void print_int_arr(int[] arr) {
			for (int i = 0; i < arr.length; i++) {
				System.out.print(arr[i] + " ");
			}
			System.out.println();
			System.out.println("---------------------");
		}

		static void print_char_arr(char[] arr) {
			for (int i = 0; i < arr.length; i++) {
				System.out.print(arr[i] + " ");
			}
			System.out.println();
			System.out.println("---------------------");
		}

		static void print_double_arr(double[] arr) {
			for (int i = 0; i < arr.length; i++) {
				System.out.print(arr[i] + " ");
			}
			System.out.println();
			System.out.println("---------------------");
		}

		static void print_2d_arr(int[][] arr, int x, int y) {
			for (int i = 0; i < x; i++) {
				for (int j = 0; j < y; j++) {
					System.out.print(arr[i][j] + " ");
				}
				System.out.println();
			}
			System.out.println();
			System.out.println("---------------------");
		}

		static void print_2d_arr(boolean[][] arr, int x, int y) {
			for (int i = 0; i < x; i++) {
				for (int j = 0; j < y; j++) {
					System.out.print(arr[i][j] + " ");
				}
				System.out.println();
			}
			System.out.println();
			System.out.println("---------------------");
		}

		static void print(Object o) {
			System.out.println(o.toString());
		}

		static void getc() {
			System.out.println("here");
		}
	}
}
