

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

public class Test5 {

    static int a, k, o=0,c;
    static int[] cou, st;
    static long sum = 0;
    static int size;

    public static void main(String[] jk) throws Exception{
        PrintWriter pw = new PrintWriter(System.out);
        StreamTokenizer tok = new StreamTokenizer(new InputStreamReader(System.in));
        tok.nextToken();
        a = (int) tok.nval;
        tok.nextToken();
        k = (int) tok.nval;
        st = new int[31];
        cou = new int[31];
        int need;
        int[] cif;
        st[0] = 1;
        int nada;
        for(int q=1; q<31; q++) st[q] = st[q-1]*2;
        for(int q=0; q<a; q++){
            tok.nextToken();
            c = (int) tok.nval;
            cou[Arrays.binarySearch(st, c)]++;
            sum+=c;
        }
        for(int q=0; q<k; q++, o=0){
            tok.nextToken();
            c = (int) tok.nval;
            if(c>sum | (cou[0]==0 & c%2>0)) o=-1;
            else if(c==sum) o=a;
            else{
                cif = f(c);
                size = cif.length;
                for(int w=0; w<size; w++){
                    if(cif[w]==1){
                        need = st[size-w-1];
                        for(int e = size-w-1, iter=0; e>=0; e--, iter++){
                            if(cou[e]>0){
                                nada = need/st[e];
                                if(cou[e]>=nada){
                                    o+=nada;
                                    need=0;
                                }
                                else{
                                    o+=cou[e];
                                    need-=cou[e]*st[e];
                                }
                            }
                            if(need==0) break;
                        }
                        if(need>0){o=-1; break;}
                    }
                }
            }
            pw.println(o);
        }
        pw.flush();
    }




    static int[] f(int i){
        char[] u = Integer.toString(i,2).toCharArray();
        int si = u.length;
        int[] o = new int[si];
        for(int q=0; q<si; q++) o[q] = u[q]-48;
        return o;
    }

    static class PyraSort {

        private static int heapSize;

        public static void sort(int[] a) {
            buildHeap(a);
            while (heapSize > 1) {
                swap(a, 0, heapSize - 1);
                heapSize--;
                heapify(a, 0);
            }
        }

        private static void buildHeap(int[] a) {
            heapSize = a.length;
            for (int i = a.length / 2; i >= 0; i--) {
                heapify(a, i);
            }
        }

        private static void heapify(int[] a, int i) {
            int l = 2 * i + 2;
            int r = 2 * i + 1;
            int largest = i;
            if (l < heapSize && a[i] < a[l]) {
                largest = l;
            }
            if (r < heapSize && a[largest] < a[r]) {
                largest = r;
            }
            if (i != largest) {
                swap(a, i, largest);
                heapify(a, largest);
            }
        }

        private static void swap(int[] a, int i, int j) {
            a[i] ^= a[j] ^= a[i];
            a[j] ^= a[i];
        }
    }
}
