#include <bits/stdc++.h>
using namespace std;
map<long long, int> mp, t;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, q;
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    long long t;
    cin >> t;
    mp[t]++;
  }
  for (int i = 1; i <= q; i++) {
    long long b;
    cin >> b;
    t = mp;
    int kq = 0, ok = 1;
    if (b % 2 == 1)
      cout << -1 << '\n';
    else {
      for (int j = 32; j > 0; j--) {
        if (!ok) break;
        if ((b >> j) & 1) {
          if (t[1 << j] > 0)
            t[1 << j]--, kq++;
          else {
            int val = 1;
            if (j == 1) {
              cout << -1 << '\n';
              ok = 0;
            }
            for (int k = j - 1; k > 0; k--) {
              if (t[1 << k] >= 2 * val) {
                t[1 << k] -= 2 * val;
                kq += 2 * val;
                break;
              } else {
                if (k == 1) {
                  cout << -1 << '\n';
                  ok = 0;
                  break;
                }
                val = val * 2 - t[1 << k];
                if (t[1 << k] > 0) {
                  kq += t[1 << k];
                  t[1 << k] = 0;
                }
              }
            }
          }
        }
      }
      if (ok) cout << kq << '\n';
    }
  }
}
