//package JCFULY3;

//import com.sun.org.apache.bcel.internal.generic.CPInstruction;

import java.io.*;
//import java.lang.reflect.Array;
import java.util.*;

public class Q4{

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader() {
            reader = new BufferedReader(new InputStreamReader(System.in), 32768);
            tokenizer = null;
        }

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(System.in), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public char nextChar() {
            return next().charAt(0);
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int[] nextIntArr(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = this.nextInt();
            }
            return arr;
        }

        public Integer[] nextIntegerArr(int n) {
            Integer[] arr = new Integer[n];
            for (int i = 0; i < n; i++) {
                arr[i] = new Integer(this.nextInt());
            }
            return arr;
        }

        public int[][] next2DIntArr(int n, int m) {
            int[][] arr = new int[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    arr[i][j] = this.nextInt();
                }
            }
            return arr;
        }

        public int[] nextSortedIntArr(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = this.nextInt();
            }
            Arrays.sort(arr);
            return arr;
        }

        public long[] nextLongArr(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = this.nextLong();
            }
            return arr;
        }

        public char[] nextCharArr(int n) {
            char[] arr = new char[n];
            for (int i = 0; i < n; i++) {
                arr[i] = this.nextChar();
            }
            return arr;
        }
    }

    public static void main(String[] args) {

        InputReader in = new InputReader();
        int N = in.nextInt();
        int k=in.nextInt();
        int input[]=new int[N];
        HashMap<Integer,Integer> map=new HashMap<>();

        for (int i = 0; i < N; i++) {
            input[i]=in.nextInt();
            if(map.containsKey(input[i]))
                map.put(input[i],map.get(input[i])+1);
            else
                map.put(input[i],1);
        }

        int Coin[]=new int[map.size()];
        int factor[]=new int[map.size()];
        int m=0;
        for (Map.Entry<Integer,Integer> map1:  map.entrySet()) {
            Coin[m]=map1.getKey();
            m++;
        }
        Arrays.sort(Coin);
        for(int i=0;i<Coin.length;i++)
            factor[i]=map.get(Coin[i]);

        long FinalAns=0;

        for(int t=0;t<k;t++){

            int Q=in.nextInt();
            int temp=Q;
            FinalAns=0;

            for(int i=Coin.length-1;i>=0;i--){

                if(Coin[i]>temp)
                    continue;

                int factor1=factor[i];


                int b=temp/ Coin[i];

                if(b>=factor1){

                    FinalAns+=factor1;
                    temp=temp-(Coin[i]*factor1);
//                    System.out.println(FinalAns+"       "+temp);

                    continue;
                }

                FinalAns+=b;
                temp=temp-(Coin[i]*b);


//                    temp-=Coin[i];
//                    factor1--;
//                    FinalAns++;
//


            }


            if(temp!=0) {
                System.out.println(-1);
                continue;
            }
            System.out.println(FinalAns);

        }
    }

    static int upperBound(long[] list, long val) {
        int count = list.length - 1, first = 0, it = 0, step = 0;

        while (count > 0) {
            it = first;
            step = count / 2;
            it += step;
            if (!(val < list[it])) {
                first = it + 1;
                it++;
                count -= step + 1;
            } else {
                count = step;
            }
        }
        return first;
    }

}
