import java.io.*;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.*;

public class Solution{
    
    public static void main(String[] args)
    {    
        InputReader in=new InputReader(System.in);    
        StringBuffer str=new StringBuffer();
        int i,j,k,n,q,t;
        n=in.nextInt();
        q=in.nextInt();
        HashMap<Long,Integer> hm=new HashMap<>();
        long pp[]=new long[31];
        pp[0]=1;
        for(i=1;i<=30;i++){
            pp[i]=pp[i-1]*2;
        }
        long a[]=new long[n];
        for(i=0;i<n;i++){
            a[i]=in.nextLong();
            try{
                hm.put(a[i],hm.get(a[i])+1);
                //System.out.println(a[i]+" "+hm.get(a[i]));
            }
            catch(Exception e){
                hm.put(a[i],1);
                //System.out.println(a[i]+" "+hm.get(a[i]));
            }
        }
        for(i=0;i<q;i++){
            long xx=in.nextLong();
            int fin=0;
            for(j=30;j>=0;j--){
                long xp=pp[j];
                //System.out.println(xx+" "+pp[j]);
                int cc=(int)(xx/xp);
                if(hm.containsKey(xp)){
                    //System.out.println(xx+" "+pp[j]);
                    int zz=Math.min(hm.get(xp),cc);
                    fin+=zz;
                    xx-=zz*xp;
                }
                if(xx==0)
                    break;
            }
            if(xx==0){
                str.append(fin+"\n");
            }else{
                str.append(-1+"\n");
            }
        }
        System.out.println(str);
    }

    static class InputReader{
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
 
        public InputReader(InputStream stream) {
            this.stream = stream;
        }
 
        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
 
        public int peek() {
            if (numChars == -1)
                return -1;
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    return -1;
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar];
        }
 
        public void skip(int x) {
            while (x-- > 0)
                read();
        }
 
        public int nextInt() {
            return Integer.parseInt(next());
        }
 
        public long nextLong() {
            return Long.parseLong(next());
        }
 
        public String nextString() {
            return next();
        }
 
        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
 
            return res.toString();
        }
 
        public String nextLine() {
            StringBuffer buf = new StringBuffer();
            int c = read();
            while (c != '\n' && c != -1) {
                if (c != '\r')
                    buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }
 
        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
 
        public boolean hasNext() {
            int value;
            while (isSpaceChar(value = peek()) && value != -1)
                read();
            return value != -1;
        }
 
        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
    }
} 