#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, q;
  scanf("%d %d", &n, &q);
  vector<int> t(32);
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    int j = 0;
    while (((1 << j) & a) == 0) j++;
    t[j]++;
  }
  while (q--) {
    int b;
    scanf("%d", &b);
    int ans = 0;
    vector<int> c(t);
    int l = n;
    while (b) {
      if (l == 0) {
        ans = -1;
        break;
      }
      int i = 0;
      while ((1 << i) <= b) i++;
      i--;
      while (i >= 0 && c[i] == 0) i--;
      if (i < 0) {
        ans = -1;
        break;
      }
      int x;
      for (x = 1; x <= c[i]; x <<= 1) {
        if ((long long)x * (long long)(1 << i) > b) {
          break;
        }
      }
      x >>= 1;
      c[i] -= x;
      b -= (long long)x * (1 << i);
      ans += x;
    }
    printf("%d\n", ans);
  }
  return (0);
}
