#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 6;
int coin[35];
int main() {
  int n, q;
  while (scanf("%d%d", &n, &q) != EOF) {
    memset(coin, 0, sizeof(coin));
    ;
    int val;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &val);
      coin[(int)(log2(val))]++;
    }
    while (q--) {
      int ans = 0;
      scanf("%d", &val);
      for (int i = log2(val); i >= 0; i--) {
        if ((1 << i) > val) continue;
        if ((1 << i) * coin[i] >= val) {
          ans += val / (1 << i);
          val %= (1 << i);
          continue;
        } else {
          val -= (1 << i) * coin[i];
          ans += coin[i];
        }
      }
      if (val)
        printf("-1\n");
      else
        printf("%d\n", ans);
    }
  }
}
