#include <bits/stdc++.h>
using namespace std;
vector<int> adj[200105];
int xMove[] = {0, 1, 0, -1, 1, 1, -1, -1, 2, 2, -2, -2, 1, 1, -1, -1};
int yMove[] = {1, 0, -1, 0, 1, -1, 1, -1, 1, -1, 1, -1, 2, -2, 2, -2};
int main() {
  cin.tie(0), cout.tie(0);
  ios_base::sync_with_stdio(0);
  int TC = 1;
  int n, m, q, k;
  {
    cin >> n >> q;
    int power2[32] = {};
    for (int i = 0; i < n; i++) {
      cin >> m;
      for (int i = 0; i < 31; i++)
        if (m & (1 << i)) {
          power2[i]++;
          break;
        }
    }
    for (int i = 0; i < q; i++) {
      cin >> m;
      int ans = 0;
      for (int j = 30; j >= 0; j--) {
        int mn = min(m / (1 << j), power2[j]);
        ans += mn;
        m -= mn * (1 << j);
        if (m == 0) break;
      }
      if (!m)
        cout << ans << '\n';
      else
        cout << "-1\n";
    }
  }
  return 0;
}
