#include <bits/stdc++.h>
using namespace std;
const int maxn = 10005;
const int INF = 0x3f3f3f3f;
const float mod = 1e-6;
int main() {
  map<int, int> mp;
  int n, q, qu, ans, ma = 0;
  scanf("%d %d", &n, &q);
  for (int i = 0; i < n; i++) {
    int t;
    scanf("%d", &t);
    ma = max(ma, t);
    mp[t]++;
  }
  while (q--) {
    scanf("%d", &qu);
    ans = 0;
    for (int i = ma; i >= 1; i /= 2) {
      ans += min(mp[i], qu / i);
      qu -= min(mp[i], qu / i) * i;
    }
    if (qu)
      printf("-1\n");
    else
      printf("%d\n", ans);
  }
}
