#include <bits/stdc++.h>
using namespace std;
int n, q;
int t[200010], p[50];
map<int, int> mp;
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &t[i]);
    mp[t[i]]++;
  }
  p[0] = 1;
  for (int i = 1; i < 32; i++) p[i] = p[i - 1] * 2;
  for (int i = 1; i <= q; i++) {
    int x, answer = 0;
    scanf("%d", &x);
    for (int i = 31; i >= 0 && x > 0; i--) {
      int y = min(x / p[i], mp[t[i]]);
      answer += y;
      x = x - y * p[i];
    }
    if (x > 0)
      printf("-1\n");
    else
      printf("%d\n", answer);
  }
  return 0;
}
