#include <bits/stdc++.h>
const int maxn = 100005;
using namespace std;
inline int rd() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int num[50];
int main() {
  int n = rd(), q = rd();
  for (int i = 1; i <= n; i++) {
    int x = rd(), cnt = 0;
    while (x) cnt++, x >>= 1;
    num[cnt - 1]++;
  }
  while (q--) {
    int a = rd(), ans = 0;
    int t = log(a) / log(2);
    for (int i = 35; i >= 0; i--) {
      int x = (1 << i);
      int s = a / x;
      if (num[i] >= s)
        ans += s, a -= s * x;
      else
        ans += num[i], a -= num[i] * x;
    }
    if (a != 0)
      puts("-1");
    else
      printf("%d\n", ans);
  }
}
