#include <bits/stdc++.h>
using namespace std;
const int M1 = 1000000007;
const int M2 = 998244353;
const int N = 100005;
int arr[32];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n, m, k, a, b, temp, q, val;
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    cin >> a;
    arr[(int)log2(a)]++;
  }
  for (int x = 0; x < q; x++) {
    cin >> val;
    int curr = 0;
    int cnt = 0;
    for (int i = 31; i >= 0; i--) {
      if (arr[i] != 0) {
        if (curr + arr[i] * pow(2, i) <= val) {
          curr += pow(2, i);
          cnt += arr[i];
        } else if (curr + arr[i] * pow(2, i) > val) {
          int mul = (val - curr) / pow(2, i);
          curr += pow(2, i) * mul;
          cnt += mul;
        }
      }
    }
    if (curr == val) {
      cout << cnt << "\n";
    } else {
      cout << -1 << "\n";
    }
  }
}
