#include <bits/stdc++.h>
using namespace std;
const int MAXM = 35;
const int MAXN = 200005;
int n, q, a[MAXN], tmp[MAXM];
int cnt[MAXM], f[MAXM];
void Init() {
  f[0] = 1;
  for (int i = 1; i <= MAXM - 5; i++) f[i] = f[i - 1] * 2;
}
void check(int x) {
  for (int i = 0;; i++)
    if (f[i] == x) {
      cnt[i]++;
      return;
    }
}
void prepare() {
  for (int i = 0; i <= MAXM - 5; i++) tmp[i] = cnt[i];
}
int Get(int x, int y) {
  if (tmp[x] >= y) {
    tmp[x] -= y;
    return y;
  }
  if (x == 0) return -1;
  int u = tmp[x] + Get(x - 1, 2 * (y - tmp[x]));
  tmp[x] = 0;
  return u;
}
int main() {
  Init();
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    check(a[i]);
  }
  while (q--) {
    int w, ans = 0;
    scanf("%d", &w);
    prepare();
    for (int i = 0; w; i++) {
      if (w % 2) {
        int u = Get(i, 1);
        ans += u;
        if (u == -1) {
          ans = -1;
          break;
        }
      }
      w /= 2;
    }
    printf("%d\n", ans);
  }
}
