#include <bits/stdc++.h>
using namespace std;
int n, q;
int a[32];
int main() {
  scanf("%d%d", &n, &q);
  int x;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    int k = log2(x);
    a[k]++;
  }
  for (int i = 1; i <= q; i++) {
    int ans = 0;
    scanf("%d", &x);
    for (int j = 31; j >= 0; j--) {
      int mn = min(a[j], x / (1 << j));
      ans += mn;
      x -= (1 << j) * mn;
    }
    if (x)
      printf("-1\n");
    else
      printf("%d\n", ans);
  }
  return 0;
}
