

import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.InputMismatchException;

public class D {
    public static void main(String args[])
    {
        FastReader Reader=new FastReader(System.in);
        int N=Reader.nextInt();
        int Q=Reader.nextInt();
        int arr[]=new int[33];
        for(int i=0;i<N;i++)
        {
            int x=Reader.nextInt();
            if(x==1)
                arr[0]++;
            else {
                int val = (int)Math.round(Math.log(x) / Math.log(2));
                if(val>32)
                    System.out.println("boo");
                else
                  arr[val]++;
            }
        }
        /*for(int i=0;i<33;i++)
        {
            System.out.print(arr[i]+" ");
        }*/
        for(int i=0;i<Q;i++)
        {
            int x=Reader.nextInt();
            int ans=0;
            int count=32;
            /*int arr2[]=new int[33];
            for(int j=0;j<33;j++)
            {
                arr2[j]=arr[j];
            }*/
            //boolean flag2=true;
            //System.out.println(1073741824>0);
           // while(x>0) {
                //System.out.println(x);
                int temp = x;
                /*int count = 0;
                while (temp > 1) {
                    temp = temp / 2;
                    count++;
                }
                temp = x;
                boolean flag = false;
                count=Math.min(visited-1,count);*/
                for (int j = count; j >= 0; j--) {
                    if (arr[j] > 0) {
                        int val = temp / (int) Math.pow(2, j);
                        int y=Math.min(val, arr[j]);
                        ans += y;
                       // visited=j;
                       // arr2[j] -= y;
                        temp = temp -  y*(int)Math.pow(2,j);
                        //flag=true;
                        //System.out.println("Hi"+x);
                        //break;

                    }
                }
                /*if(flag==false)
                {
                    flag2=false;
                    break;
                }*/
            ///}
            if(temp!=0)
                System.out.println(-1);
            else
                System.out.println(ans);
        }
    }
    public static void sorts(int arr[],int N)
    {
        Integer arr_obj[]=new Integer[N];
        for(int i=0; i<N; ++i){
            arr_obj[i] = new Integer(arr[i]);
        }
        Arrays.sort(arr_obj);
        for(int i=0; i<N; ++i){
            arr[i] = arr_obj[i];
        }
    }
}
class FastReader {
    private InputStream stream;
    private byte[] buf = new byte[8192];
    private int curChar;
    private int pnumChars;
    private FastReader.SpaceCharFilter filter;

    public FastReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (pnumChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= pnumChars) {
            curChar = 0;
            try {
                pnumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (pnumChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public String next() {
        return nextString();
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c == ',') {
                c = read();
            }
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String nextString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }


    public boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null) {
            return filter.isSpaceChar(c);
        }
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

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

    }

}
