#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, q;
  cin >> n >> q;
  int c[n];
  for (int i = 0; i < n; ++i) {
    cin >> c[i];
  }
  int a[q];
  for (int i = 0; i < q; ++i) {
    cin >> a[i];
  }
  int t[31] = {0};
  for (int i = 0; i < n; ++i) {
    ++t[int(log2(c[i]))];
  }
  int two[31] = {1};
  for (int i = 0; i < 31; ++i) {
    if (i > 0) {
      two[i] = 2 * two[i - 1];
    }
  }
  int ans = 0;
  for (int i = 0; i < q; ++i) {
    ans = 0;
    for (int j = 1; j < 31; ++j) {
      if (a[i] - t[31 - j] * two[31 - j] >= 0) {
        ans += t[31 - j];
        a[i] -= t[31 - j] * two[31 - j];
      } else {
        ans += a[i] / two[31 - j];
        a[i] %= two[31 - j];
      }
      if (a[i] == 0) {
        cout << ans << endl;
        break;
      }
    }
    if (a[i] != 0) {
      cout << -1 << endl;
    }
  }
  return 0;
}
