#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

#define _ 0
#define eps 1e-9
#define endl '\n'
#define gcd __gcd
#define pi acos(-1)
#define ll long long
#define LL long long
#define IDX(x) (x - 'A')
#define idx(x) (x - 'a')
#define idz(x) (x - '0')
#define ld long double
#define lowebit(x) (x&(-x))
#define rint register int
#define Len(x) (int)(x).size()
#define all(s) (s).begin(), (s).end()
//char buf[1 << 23],*p1=buf,*p2=buf,obuf[1<<23],*O=obuf;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
using namespace std;
inline int read()
{
	register int x = 0, f = 1, ch = getchar();
	while( !isdigit(ch) ){if(ch == '-') f = -1; ch = getchar();}
	while( isdigit(ch) ){x = (x << 1) + (x << 3) + ch - 48; ch = getchar();}
	return x * f;
}
int m[35];
map<int, int> k;
int c[35];
int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    clock_t c1ockck = clock();
    // ..........................................................
    int n = read(), q = read();
    m[0] = 1;for(int i = 1 ; i <= 31 ; i ++) m[i] = m[i - 1] << 1;
    for(int i = 1 ; i <= 31 ; i ++) k[m[i]] =i;
    for(int i = 1 ; i<= n ; i ++){
        int x = read();
        c[k[x]] ++;
    }
    for(int i = 1 ; i <= q ; i ++){
        int ans = 0;
        int x = read();
        for(int j = 31 ; j >= 1 ; j --){
            if(m[j] > x || c[j] == 0) continue;
            int k = x / m[j];
            if(k >= c[j]){
                x -= c[j] * m[j];
                ans += c[j];
            }else{
                x -= k * m[j];
                ans += k;
            }
        }
        if(x) cout << -1 << endl;
        else cout << ans << endl;
    }
    // ..........................................................
    cerr << endl << "Time:" << clock() - c1ockck << "ms" <<endl;
    return ~~(0^_^0);
}
