#include <bits/stdc++.h>
using namespace std;
int n, q, m;
map<int, int> a;
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &m);
    a[m]++;
  }
  for (int i = 1; i <= q; i++) {
    scanf("%d", &m);
    int cnt = 1 << 30;
    int ans = 0;
    for (; cnt >= 1; cnt >>= 1) {
      if (m < cnt) {
        continue;
      }
      int cmt = min(m / cnt, a[cnt]);
      m -= cmt * cnt;
      ans += cmt;
    }
    if (m == 0) {
      printf("%d\n", ans);
    } else
      printf("-1\n");
  }
  return 0;
}
