#include <bits/stdc++.h>
using namespace std;
long long int coins[32];
map<long long int, long long int> val;
int convert(long long int c) {
  int ret = -1;
  while (c) {
    c = c / 2;
    ret++;
  }
  return ret;
  cout << ret << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    long long int c;
    cin >> c;
    long long int con = convert(c);
    val[con] = c;
    coins[con]++;
  }
  while (q--) {
    long long int b;
    long long int copy[32];
    cin >> b;
    for (int i = 0; i < 32; i++) {
      copy[i] = coins[i];
    }
    long long int ans = 0;
    for (int i = 31; i >= 0;) {
      if (b >= val[i] && copy[i] > 0) {
        int f = b / val[i];
        ans += f;
        b -= f * val[i];
      } else {
        i--;
      }
      if (b == 0) {
        break;
      }
    }
    if (b == 0)
      cout << ans << "\n";
    else {
      cout << -1 << "\n";
    }
  }
  return 0;
}
