#include <bits/stdc++.h>
using namespace std;
long long dx[] = {-1, 0, 1, 0};
long long dy[] = {0, 1, 0, -1};
long long spf[10];
void sieve() {
  long long i, j;
  for (i = 0; i < 10; i++) spf[i] = i;
  for (i = 4; i < 10; i += 2) spf[i] = 2;
  for (i = 3; i * i < 10; i++) {
    if (spf[i] == i) {
      for (j = i * i; j < 10; j += i) {
        if (spf[j] == j) spf[j] = i;
      }
    }
  }
}
bool isvowel(char c) {
  switch (c) {
    case 'a':
    case 'e':
    case 'i':
    case 'o':
    case 'u':
    case 'y':
      return true;
    default:
      return false;
  }
}
bool cmp(pair<long long, long long> x, pair<long long, long long> y) {
  return x.first > y.first;
}
long long isPrime(long long n) {
  for (long long i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) {
      return i;
    }
  }
  return n;
}
long long sum(long long n) {
  long long ans = 0;
  while (n > 0) {
    long long d = n % 10;
    ans += d;
    n /= 10;
  }
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    long long n, q;
    cin >> n >> q;
    long long a[n];
    map<long long, long long> mp;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      mp[a[i]]++;
    }
    while (q--) {
      long long sum;
      cin >> sum;
      bitset<32> b = sum;
      long long ans = 0;
      long long flag1 = 0;
      for (long long i = 0; i < 32; i++) {
        if (b[i] == 1) {
          long long flag = 0;
          long long y = 1 << i;
          long long y1 = y;
          long long cnt = 1;
          while (y > 0) {
            if (mp[y]) {
              long long z = min(cnt, mp[y]);
              ans += z;
              if ((y1 - z * y) == 0) {
                flag = 1;
                break;
              }
              mp[y] -= z;
              y = y1 - cnt * y;
              cnt = 1;
            }
            y /= 2;
            cnt *= 2;
          }
          if (flag == 1)
            sum -= (y1);
          else {
            break;
          }
        }
      }
      if (sum == 0) {
        cout << ans << "\n";
      } else {
        cout << "-1"
             << "\n";
      }
    }
  }
  return 0;
}
