#include <bits/stdc++.h>
using namespace std;
long long int n, q, a, cnt[100], b, ans, cur;
int main() {
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    long long int j;
    for (j = 0; a > 1; j++) a /= 2;
    cnt[j]++;
    cur = max(cur, j);
  }
  while (q--) {
    cin >> b;
    long long int p = 1, j = 0;
    while (p * 2 < b || j + 1 <= cur) p *= 2, j++;
    ans = 0;
    while (p > 0 && b > 0) {
      a = min(cnt[j], b / p);
      ans += a;
      b -= a * p;
      p /= 2;
      j--;
    }
    if (b != 0)
      cout << -1 << endl;
    else
      cout << ans << endl;
  }
}
