#include <bits/stdc++.h>
using namespace std;
const long long INF = LONG_LONG_MAX;
const long long N = 4e2 + 5;
const long long mod = 998244353;
long long fsp(long long base, long long power) {
  if (power == 0) return 1;
  if (power == 1) return base;
  long long ans = fsp(base, power / 2);
  ans = (ans * ans);
  if (power % 2) ans *= base;
  return ans;
}
void testCase() {
  int n, q;
  cin >> n >> q;
  map<long long, long long> mp;
  for (int i = 0; i < n; i++) {
    long long in;
    cin >> in;
    mp[in]++;
  }
  while (q--) {
    long long key, kh;
    cin >> key;
    kh = key;
    bool can = false;
    long long ans = 0;
    for (int i = 33; i >= 0; i--) {
      long long num = fsp(2, i);
      ans += min(key / num, mp[num]);
      key -= (num * min(key / num, mp[num]));
    }
    if (key)
      cout << -1 << '\n';
    else
      cout << ans << '\n';
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  while (t--) testCase();
}
