#include <bits/stdc++.h>
using namespace std;
void go() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed;
  cout << setprecision(20);
}
bool compare(const pair<char, int>& p1, const pair<char, int>& p2) {
  return p1.second < p2.second;
}
void helper(unordered_map<int, int> mp) {
  int n;
  cin >> n;
  int cnt = 0;
  for (int i = 31; i >= 0; i--) {
    int temp = (1 << i);
    if (mp.find(temp) != mp.end() and n >= temp) {
      cnt += min(n / temp, mp[temp]);
      n -= min(n / temp, mp[temp]) * temp;
    }
  }
  cout << (n == 0 ? cnt : -1) << endl;
}
int main() {
  go();
  int n, q;
  cin >> n >> q;
  unordered_map<int, int> mp;
  for (int i = 0; i < n; i += 1) {
    int inp;
    cin >> inp;
    mp[inp]++;
  }
  for (int i = 0; i < q; i += 1) {
    helper(mp);
  }
}
