import javafx.util.Pair;

import java.io.*;
import java.security.acl.LastOwnerException;
import java.util.*;

import static java.lang.Math.*;

public class bigo1 {

    public static TreeSet<String> hs;
    public static ArrayList<Integer> graph[];
    public static int []c ;
    public static InputReader in;
    public static PrintWriter out;
    // public static long memory[][][] = new long[105][2][2];
    public static String b;
    public static int n , k ,x;
    public static void main(String[] args) throws IOException {

        // BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        in = new InputReader(System.in);
        out = new PrintWriter(System.out);

        int n = in.nextInt();
        int q = in.nextInt();
       // out.println(Math.log(8)/Math.log(2));
        int []pre = new int[1000];
        for (int i = 0 ;i<n;i++)
        {
            pre[(int) (Math.log(in.nextInt())/Math.log(2))]++;
        }
       /* for (int i : pre)
        {
            if(i<10)
            {
                out.print(i+" ");
            }
        }
        out.println();
*/
       for (int i = 0 ;i<q;i++)
       {
           long x = in.nextLong();
           int cnt = 0;
           for (int j = 32;j>=0;j--)
           {
               if(pre[j] == 0 || x<Math.pow(2,j)) {

                   if(j<=3)
                   {
                      // out.println(j);
                   }
                   continue;
               }
               else
               {
                   if(x-pre[j] * Math.pow(2,j) >= 0)
                   {
                     //  out.println(j+" jaya");
                       x-=pre[j] * (long)Math.pow(2,j);
                      // out.println(x+" aya");
                   }else
                   {
                      // out.println(x+"cnt kitna hai");
                       x-=(x/(long)Math.pow(2,j)) * (long)Math.pow(2,j);
                       pre[j]-=(x/(long)Math.pow(2,j));
                   }
                   cnt++;

               }
           }
           if(x == 0)
           {
               out.print(cnt+" ");
           }else
           {
               out.print("-1 ");
           }
       }




        out.close();

    }



    public static long gcd(long x, long y) {
        if (x == 0)
            return y;
        else
            return gcd( y % x,x);
    }
    public static long mod = 1000000007, inf = 100000000000000000l;
    public static long fac[],inv[];
    public static void cal()
    {
        fac = new long[1000005];
        inv = new long[1000005];
        fac[0]=1;
        inv[0]=1;
        for(int i=1; i<=1000000; i++)
        {
            fac[i]=(fac[i-1]*i)%mod;
            inv[i]=(inv[i-1]*modPow(i,mod-2,mod))%mod;

        }
    }
    public static long ncr(int n, int r)
    {
        return (((fac[n]*inv[r])%mod)*inv[n-r])%mod;
    }
    public static long modPow(long base, long exp, long mod) {
        base = base % mod;
        long result =1;
        while(exp > 0)
        {
            if(exp % 2== 1)
            {
                result = (result * base) % mod;
                exp --;
            }
            else
            {
                base = (base * base) % mod;
                exp = exp >> 1;
            }

        }
        return result;
    }



    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private InputReader.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 boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

}