#include <bits/stdc++.h>
using namespace std;
int n, q, a, u[30], d[30];
int sol(int k) {
  int c = 0;
  while (k != 1) {
    k >>= 1;
    c++;
  }
  return c;
}
int main() {
  while (~scanf("%d%d", &n, &q)) {
    memset(u, 0, sizeof(u));
    for (int i = 0; i < n; i++) {
      cin >> a;
      u[sol(a)]++;
    }
    for (int i = 0; i < q; i++) {
      cin >> a;
      if (a % 2)
        cout << -1 << endl;
      else {
        memset(d, 0, sizeof(d));
        int j = 0, ans = 0;
        while (a) {
          if (a & 1) {
            d[j] = 1;
          }
          a >>= 1;
          j++;
        }
        for (int r = j - 1; r >= 0; r--) {
          if (u[r] >= d[r] && d[r])
            ans += d[r];
          else if (d[r] && r) {
            ans += u[r];
            int k = (d[r] - u[r]) * 2;
            d[r - 1] += k;
          }
        }
        if (d[0])
          cout << -1 << endl;
        else
          cout << ans << endl;
      }
    }
  }
}
