
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class Main {

    public static boolean isPowOf2(int x) {
        return (x != 0) && ((x & (x - 1)) == 0);
    }

    public static void main(String[] args) throws IOException {

        Scanner sc = new Scanner();
        int n = Integer.parseInt(sc.next());
        int q = Integer.parseInt(sc.next());
        TreeMap<Integer, Integer> map = new TreeMap<>(Collections.reverseOrder());
        int num;
        for (int i = 0; i < n; i++) {
            num = Integer.parseInt(sc.next());
            if (map.containsKey(num)) {
                map.put(num, map.remove(num) + 1);
            } else {
                map.put(num, 1);
            }
        }
       int qkaso;
       int rt;
       int sd;
       int aux;
        for (int i = 0; i < q; i++) {
            qkaso=Integer.parseInt(sc.next()); 
            
            
            
                 rt=0;
                 sd=0;
                for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
                    Integer key = entry.getKey();
                    Integer value = entry.getValue();  
                    aux=(int)Math.min(Math.ceil(qkaso/key), value);
                    rt+=aux;
                    qkaso-=aux*key;
                    if(qkaso==0)break;
                    
                }
                if(qkaso==0)System.out.println(rt);
                else System.out.println(-1);
              
            
        }


    }

    static class Scanner {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        StringTokenizer st = new StringTokenizer("");

        int spaces = 0;

        public String nextLine() throws IOException {

            if (spaces-- > 0) {

                return "";

            } else if (st.hasMoreTokens()) {

                return new StringBuilder(st.nextToken("\n")).toString();

            }

            return br.readLine();

        }

        public String next() throws IOException {

            spaces = 0;

            while (!st.hasMoreTokens()) {

                st = new StringTokenizer(br.readLine());

            }

            return st.nextToken();

        }

        public boolean hasNext() throws IOException {

            while (!st.hasMoreTokens()) {

                String line = br.readLine();

                if (line == null) {

                    return false;

                }

                if (line.equals("")) {

                    spaces = Math.max(spaces, 0) + 1;

                }

                st = new StringTokenizer(line);

            }

            return true;

        }

    }

}
