#include <bits/stdc++.h>
const int maxn = 8005;
const int inf = 0x3f3f3f3f;
const long long mod = 998244353;
using namespace std;
long long vis[111];
int main() {
  long long x = 1ll, y;
  int n, q;
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &y);
    for (int j = 0; j <= 33; ++j) {
      if ((x << j) == y) {
        ++vis[j];
        break;
      }
    }
  }
  for (int i = 1; i <= q; ++i) {
    scanf("%lld", &y);
    long long cnt = 0;
    for (int j = 33; j >= 0; --j) {
      cnt += min(y / (x << j), vis[j]);
      y -= (x << j) * min(y / (x << j), vis[j]);
    }
    if (y) cnt = -1;
    printf("%lld\n", cnt);
  }
  return 0;
}
