//package solution;

import java.io.*;
import java.util.*;

public final class Solution {
    BufferedReader br;
    StringTokenizer stk;

    public static void main(String[] args) throws Exception {
        new Solution().run();
    }
    
    {
        stk = null;
        br = new BufferedReader(new InputStreamReader(System.in));
    }
    
    long mod = 1000_000_000 + 7;
    StringBuilder res = new StringBuilder(1000005);
    
    void run() throws Exception {
        int n = ni();
        int q = ni();
        HashMap<Long, Integer> map = new HashMap<>();
        for(int i = 0; i < n; i++) {
            long num = nl();
            map.put(num, map.getOrDefault(num, 0) + 1);
        }
        
        while(q-- > 0) {
            long num = nl();
            long closestPowerOfTwo = Long.highestOneBit(num);
            int used = 0;
            boolean ok = false;
            while(closestPowerOfTwo > 0) {
                long min = Math.min(map.getOrDefault(closestPowerOfTwo, 0), num / closestPowerOfTwo);
                num -= min * closestPowerOfTwo;
                used += min;
                if(num == 0) {
                    ok = true;
                    break;
                }
                closestPowerOfTwo /= 2;
            }
            res.append(ok ? used : -1).append("\n");
        }
        
        System.out.print(res);
    }
    
    int form(int idx, int need, int used, int[] a) {
        if(idx == -1) {
            return Integer.MIN_VALUE / 3;
        }
        if(need <= a[idx]) {
            a[idx] -= need;
            used += need;
            return used;
        } else {
            used += a[idx];
            need -= a[idx];
            a[idx] = 0;
            return form(idx - 1, need * 2, used, a);
        }
    }
    
    //Reader & Writer
    String nextToken() throws Exception {
        if (stk == null || !stk.hasMoreTokens()) {
            stk = new StringTokenizer(br.readLine(), " ");
        }
        return stk.nextToken();
    }

    String nt() throws Exception {
        return nextToken();
    }

    int ni() throws Exception {
        return Integer.parseInt(nextToken());
    }

    long nl() throws Exception {
        return Long.parseLong(nextToken());
    }
}