import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * Created by artur on 18/06/18
 */
public class A
{
    private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    private StringTokenizer tokenizer = null;

    public static void main(String[] args) throws IOException
    {
        new A().solve();
    }

    private void solve() throws IOException
    {
        int n = ni();
        int q = ni();
        int [] pow = new int[32];
        int [] ps = new int[32];
        for (int i = 0; i <= 31; i++)
        {
            ps[i] = (int) Math.pow(2, i);
        }
        for (int i = 0; i < n; i++)
        {
            int x = ni();
            pow[(int) Math.ceil(Math.log(x))]++;
        }
        for (int i = 0; i < q; i++)
        {
            int x = ni();
            int cnt = 0;
            int pos = (int) Math.ceil(Math.log(x)) + 1;
            while (pos >= 0 && x > 0) {
                int co = Math.min(pow[pos], x / ps[pos]);
                x -= co * ps[pos];
                cnt += co;
                pos -= 1;
            }
            if (pos == -1 && x > 0)
            {
                System.out.println(-1);
            }
            else
            {
                System.out.println(cnt);
            }
        }
    }


    void debug(Object... os)
    {
        System.out.println(Arrays.deepToString(os));
    }

    int ni() throws IOException
    {
        return Integer.parseInt(ns());
    }

    long nl() throws IOException
    {
        return Long.parseLong(ns());
    }

    double nd() throws IOException
    {
        return Double.parseDouble(ns());
    }

    String ns() throws IOException
    {
        while (tokenizer == null || !tokenizer.hasMoreTokens())
            tokenizer = new StringTokenizer(br.readLine());
        return tokenizer.nextToken();
    }

    String nline() throws IOException
    {
        tokenizer = null;
        return br.readLine();
    }

    private static long gcd(long a, long b)
    {
        while (b > 0)
        {
            long temp = b;
            b = a % b; // % is remainder
            a = temp;
        }
        return a;
    }

    private static long lcm(long a, long b)
    {
        return a * (b / gcd(a, b));
    }
}
