#include <bits/stdc++.h>
using namespace std;
int gcd(int A, int B) {
  if (B == 0)
    return A;
  else
    return gcd(B, A % B);
}
long long int mod_exponentiation(long long int base, long long int exponent,
                                 int modulus) {
  long long int result = 1;
  while (exponent > 0) {
    if (exponent % 2 == 1) result = (result * base) % modulus;
    exponent = exponent >> 1;
    base = (base * base) % modulus;
  }
  return result;
}
int fermat(long long int n, long long int m) {
  return mod_exponentiation(n, m - 2, m);
}
struct node {
  int a;
  int cnt;
};
struct Compare {
  bool operator()(node &a, node &b) { return a.cnt > b.cnt; }
};
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
int dr[] = {0, -1, 1, 0, -1, 1, -1, 1};
int dc[] = {1, 1, 1, -1, -1, -1, 0, 0};
int main() {
  map<int, int> tmp;
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    for (int i = 0; i < 25; i++) {
      if (x & (1 << i)) {
        tmp[i]++;
        break;
      }
    }
  }
  while (q--) {
    map<int, int> m;
    for (__typeof(tmp.begin()) it = tmp.begin(); it != tmp.end(); it++) {
      m.insert({it->first, it->second});
    }
    int a;
    cin >> a;
    int cnt = 0;
    for (int i = 25; i >= 0; i--) {
      if ((1 << i) & (a)) {
        if (m.find(i) != m.end()) {
          a -= (1 << i);
          cnt++;
          m[i]--;
          if (m[i] == 0) {
            m.erase(m.find(i));
          }
        } else {
          for (int j = i - 1; j >= 0; j--) {
            if (m.find(j) != m.end()) {
              int req = (1 << (i - j));
              int avail = m[j];
              if (avail > req) {
                a -= ((1 << j) * req);
                m[j] -= req;
                cnt += req;
              } else {
                a -= ((1 << j) * avail);
                m.erase(m.find(j));
                cnt += avail;
              }
              break;
            }
          }
        }
      }
    }
    if (a != 0) {
      cout << "-1" << endl;
    } else
      cout << cnt << endl;
  }
}
