import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Array;
import java.util.*;

/*

7 3
1 2 3 4 5 6 7

*/
public class CodeForces {
    static class Node{
        int power;
        int count;
        int value;
    }

    public static void main(String[] args) {
        FastReader s=new FastReader(System.in);
        int n=s.nextInt();
        int q=s.nextInt();
        int[] arr=new int[n];
        Node[] count=new Node[31];
        for(int i=0;i<31;i++){
            count[i]=new Node();
        }
        for(int i=0;i<n;i++){
            arr[i]=s.nextInt();
            int temp=arr[i];
            int cou=-1;
            while (temp>0){
                temp/=2;
                cou++;
            }
            count[cou].power=cou;
            count[cou].value=arr[i];
            count[cou].count++;
        }
        Arrays.sort(count, new Comparator<Node>() {
            @Override
            public int compare(Node o1, Node o2) {
                return o1.count-o2.count;
            }
        });
        ArrayList<Node> list=new ArrayList<>();
        for(int i=0;i<31;i++){
            if(count[i].count!=0){
                list.add(count[i]);
            }
        }
        Collections.sort(list, new Comparator<Node>() {
            @Override
            public int compare(Node o1, Node o2) {
                return o2.power-o1.power;
            }
        });
        while (q-->0){
            int query=s.nextInt();
            int size=list.size();
            int times=0;
            for(int i=0;i<size;i++){
                if(query/list.get(i).value>0){
                    if(query/list.get(i).value>list.get(i).count){
                        times+=list.get(i).count;
                        query-=(list.get(i).value*list.get(i).count);
                    }else {
                        times+=(query/list.get(i).value);
                        query-=(list.get(i).value*(query/list.get(i).value));
                    }
                }
            }
            if(query==0){
                System.out.println(times);
            }else {
                System.out.println("-1");
            }
        }

    }
    static class FastReader {
        InputStream is;
        private byte[] inbuf = new byte[1024];
        private int lenbuf = 0, ptrbuf = 0;
        static final int ints[] = new int[128];

        public FastReader(InputStream is) {
            for (int i = '0'; i <= '9'; i++) ints[i] = i - '0';
            this.is = is;
        }

        public int readByte() {
            if (lenbuf == -1) throw new InputMismatchException();
            if (ptrbuf >= lenbuf) {
                ptrbuf = 0;
                try {
                    lenbuf = is.read(inbuf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (lenbuf <= 0) return -1;
            }
            return inbuf[ptrbuf++];
        }

        public boolean isSpaceChar(int c) {
            return !(c >= 33 && c <= 126);
        }

        public int skip() {
            int b;
            while ((b = readByte()) != -1 && isSpaceChar(b)) ;
            return b;
        }

        public String next() {
            int b = skip();
            StringBuilder sb = new StringBuilder();
            while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

        public int nextInt() {
            int num = 0, b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }

            while (true) {
                if (b >= '0' && b <= '9') {
                    num = (num << 3) + (num << 1) + ints[b];
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

        public long nextLong() {
            long num = 0;
            int b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }

            while (true) {
                if (b >= '0' && b <= '9') {
                    num = (num << 3) + (num << 1) + ints[b];
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
       /* public char nextChar() {
            return (char)skip();
        }*/

        public char[] next(int n) {
            char[] buf = new char[n];
            int b = skip(), p = 0;
            while (p < n && !(isSpaceChar(b))) {
                buf[p++] = (char) b;
                b = readByte();
            }
            return n == p ? buf : Arrays.copyOf(buf, p);
        }

        /*private char buff[] = new char[1005];
        public char[] nextCharArray(){
            int b = skip(), p = 0;
            while(!(isSpaceChar(b))){
                buff[p++] = (char)b;
                b = readByte();
            }
            return Arrays.copyOf(buff, p);
        }*/
    }
}