#include <bits/stdc++.h>
using namespace std;
const long long N = 5e3 + 7;
const long long inf = 1e9 + 7;
const long long mod = 1e9 + 7;
int n;
int k;
int x;
int ans;
int a[30];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 1, x; i <= n; i++) {
    cin >> x;
    a[(int)log2(x)]++;
  }
  while (k--) {
    ans = 0;
    cin >> x;
    for (int i = 29; i >= 0; i--) {
      if (a[i] == 0) {
        continue;
      }
      int can = x / (1 << i);
      x -= can * (1 << i);
      ans += can;
    }
    if (x > 0) {
      ans = -1;
    }
    cout << ans << "\n";
  }
}
