import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
public class prog3{
    static int query(int freq[], long input){
        int ans = 0, k = 0;
        while((long)Math.pow(2, k)<=input)
            k++;
        k--;
            
        while(k>=0 && input>0){
            int req = (int)(input/(long)Math.pow(2, k));
            if(freq[k]>=req){
                freq[k] -= req;
                input -= (long)Math.pow(2, k)*req;
                ans += req;
            }
            else{
                input -=(long)Math.pow(2, k)*freq[k];
                ans += freq[k];
                freq[k] = 0;
            }
            k--;
            //System.out.println(ans);
        }
        if(input>0)
            return -1;
        return ans;
    }
    public static void main(String args[])throws IOException{
        InputReader sc = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        
        int n = sc.nextInt(), q = sc.nextInt();
        int freq[] = new int[32];
        while(n-->0){
            long input = sc.nextLong();
            int k = 0;
            while(input!=1){
                k++;
                input = input>>1;
            }
            freq[k]++;
        }
        while(q-->0){
            long input = sc.nextLong();
            int f[] = new int[32];
            for(int i=0; i<32; i++)
            	f[i] = freq[i];
            pw.println(query(f, input));
        }
        
        pw.flush();
        pw.close();
    }
    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 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);
        }
    }
}