#include <bits/stdc++.h>
using namespace std;
long long po[40];
int n, q, temp;
int main() {
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    scanf("%d", &temp);
    long long l = (long long)log(temp);
    po[l + 1]++;
  }
  for (int i = 1; i <= q; i++) {
    scanf("%d", &temp);
    long long ans = 0;
    for (int i = 30; i >= 0; i--) {
      if (po[i] != 0) {
        long long ae = po[i];
        long long bhag = (temp) / (long long)pow(2, i);
        ans += min(bhag, ae);
        temp -= (min(bhag, ae) * (long long)pow(2, i));
      }
      if (temp == 0) break;
    }
    if (temp == 0) {
      printf("%d\n", ans);
    } else {
      printf("-1\n");
    }
  }
  return 0;
}
