	import java.util.*;
	import java.io.*;
	
	public class D1003
	{
		public static void main(String[] args)
		{
			InputReader in = new InputReader(System.in);
			PrintWriter pw = new PrintWriter(System.out);
			
			int n = in.nextInt();
			int q = in.nextInt();
			long[] a = new long[n];
			long b = 0, d = 0, min = 0, count = 0;
			int j = n - 1;
			HashMap<Long, Integer> hmap = new HashMap<>();
			TreeSet<Long> Tset = new TreeSet<>();
			
			for(int i=0;i<n;i++)
			{
				a[i] = in.nextLong();
				Tset.add(-a[i]);
				
				if(!hmap.containsKey(a[i]))
					hmap.put(a[i], 1);
				else
					hmap.put(a[i], hmap.get(a[i])+1);
			}
			
			Arrays.sort(a);
			
			for(int i=0;i<q;i++)
			{
				b = in.nextLong();
				
				for(long l : Tset)
				{
					d = b/(-l);
					min = Math.min(d,  hmap.get(-l));
					b = b - min*(-l);
					count += min;
					
					if(b == 0)
						break;
				}
				
				if(b != 0)
					count = -1;
				
				pw.println(count);
				count = 0;
				j = n - 1;
			}
			
			pw.flush();
			pw.close();
		}
	
		public static long modularExponentiation(long x,long n,long M)
		{
		    long result=1;
		    while(n>0)
		    {
		        if(n % 2 ==1)
		            result=(result * x)%M;
		        x=(x*x)%M;
		        n=n/2;
		    }
		    return result;
		}
		
		public static long GCD(long a,long b)
		{
			if(b==0)
				return a;
			else
				return GCD(b,a%b);
		}
		
		static class InputReader 
		{
			 
			private final InputStream stream;
			private final byte[] buf = new byte[8192];
			private int curChar, snumChars;
			private SpaceCharFilter filter;
	 
			public InputReader(InputStream stream) 
			{
				this.stream = stream;
			}
	 
			public int snext() 
			{
				if (snumChars == -1)
					throw new InputMismatchException();
				if (curChar >= snumChars) 
				{
					curChar = 0;
					try 
					{
						snumChars = stream.read(buf);
					} 
					catch (IOException e) 
					{
						throw new InputMismatchException();
					}
					if (snumChars <= 0)
						return -1;
				}
				return buf[curChar++];
			}
	 
			public int nextInt() 
		    {
				int c = snext();
				while (isSpaceChar(c)) 
				{
					c = snext();
				}
				int sgn = 1;
				if (c == '-')
			    {
					sgn = -1;
					c = snext();
				}
				int res = 0;
				do 
				{
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					res *= 10;
					res += c - '0';
					c = snext();
				} while (!isSpaceChar(c));
				return res * sgn;
			}
	 
			public long nextLong()
		    {
				int c = snext();
				while (isSpaceChar(c)) 
				{
					c = snext();
				}
				int sgn = 1;
				if (c == '-') 
				{
					sgn = -1;
					c = snext();
				}
				long res = 0;
				do 
				{
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					res *= 10;
					res += c - '0';
					c = snext();
				} while (!isSpaceChar(c));
				return res * sgn;
			}
	 
			public int[] nextIntArray(int n) 
			{
				int a[] = new int[n];
				for (int i = 0; i < n; i++) 
				{
					a[i] = nextInt();
				}
				return a;
			}
	 
			public String readString()
		    {
				int c = snext();
				while (isSpaceChar(c)) 
				{
					c = snext();
				}
				StringBuilder res = new StringBuilder();
				do 
				{
					res.appendCodePoint(c);
					c = snext();
				} while (!isSpaceChar(c));
				return res.toString();
			}
	 
			public String nextLine() 
			{
				int c = snext();
				while (isSpaceChar(c))
					c = snext();
				StringBuilder res = new StringBuilder();
				do 
				{
					res.appendCodePoint(c);
					c = snext();
				} while (!isEndOfLine(c));
				return res.toString();
			}
	 
			public boolean isSpaceChar(int c) 
			{
				if (filter != null)
					return filter.isSpaceChar(c);
				return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
			}
	 
			private boolean isEndOfLine(int c) 
			{
				return c == '\n' || c == '\r' || c == -1;
			}
	 
			public interface SpaceCharFilter
		    {
				public boolean isSpaceChar(int ch);
			}
		}
		
		/*static class CodeX {
        public static void sort(long arr[]) {
            merge_sort(arr, 0, arr.length - 1);
        }

        private static void merge_sort(long A[], long start, long end) {
            if (start < end) {
                long mid = (start + end) / 2;
                merge_sort(A, start, mid);
                merge_sort(A, mid + 1, end);
                merge(A, start, mid, end);
            }

        }

        private static void merge(long A[], long start,long mid, long end) {
            long p = start, q = mid + 1;
            long Arr[] = new long[(int)(end - start + 1)];
            long k = 0;

            for (int i = (int)start; i <= end; i++) {
                if (p > mid)
                    Arr[(int)k++] = A[(int)q++];

                else if (q > end)
                    Arr[(int)k++] = A[(int)p++];

                else if (A[(int)p] < A[(int)q])
                    Arr[(int)k++] = A[(int)p++];

                else
                    Arr[(int)k++] = A[(int)q++];
            }
            for (int i = 0; i < k; i++) {
                A[(int)start++] = Arr[i];
            }

        }

    }*/
	}	
		