#include <bits/stdc++.h>
using namespace std;
int get_n(int x) {
  int ans = -1;
  while (x) {
    x >>= 1;
    ans++;
  }
  return ans;
}
int go[44];
int hi[44];
int dfs(int bit, int cnt) {
  if (bit < 0) return -1;
  if (hi[bit] >= cnt) {
    hi[bit] -= cnt;
    return cnt;
  }
  int temp = hi[bit];
  hi[bit] = 0;
  cnt -= temp;
  cnt *= 2;
  return temp + dfs(bit - 1, cnt);
}
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    go[get_n(x)]++;
  }
  while (k--) {
    int x;
    scanf("%d", &x);
    memcpy(hi, go, sizeof(go));
    int ans = 0;
    bool flag = true;
    while (x) {
      int low = get_n(x & -x);
      x -= x & -x;
      int cnt = dfs(low, 1);
      if (cnt == -1) {
        flag = false;
        break;
      }
      ans += cnt;
    }
    if (flag)
      printf("%d\n", ans);
    else
      puts("-1");
  }
}
