import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int q = scanner.nextInt();

        Boolean[] mark = new Boolean[32];
        Arrays.fill(mark, false);
        for (int i = 0; i < n; i++) {
            int a = scanner.nextInt();

            int k;
            for (k = 0; 1 << k < a; k++);

            mark[k] = true;
        }

        for (int i = 0; i < q; i++)
        {
            int t = scanner.nextInt();

            int cnt = 0;
            boolean lc = true;
            while (t > 0)
            {
                int lsb = t & (-t);

                int k;
                for (k = 0; 1 << k < lsb; k++);

                boolean lc1 = false;
                for (int j = k; j >= 0; j--)
                    if (mark[j])
                    {
                        cnt += k - j + 1;
                        lc1 = true;
                        break;
                    }

                 if (!lc1)
                 {
                     System.out.println(-1);
                     lc = false;
                     break;
                 }

                 t -= lsb;
            }

            if (lc)
                System.out.println(cnt);
        }
    }
}
