#include <bits/stdc++.h>
using namespace std;
long long arr[1000], arr1[1000], dp[1000];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long i, j, k, x, y, z, n, m, a, b, p, q, f;
  dp[0] = 1;
  for (i = 1; i <= 22; i++) {
    dp[i] = dp[i - 1] * 2;
  }
  cin >> n >> q;
  for (i = 0; i < n; i++) {
    cin >> a;
    y = 0;
    while (a > 1) {
      a /= 2;
      y++;
    }
    arr[y]++;
  }
  while (q--) {
    for (i = 0; i < 25; i++) {
      arr1[i] = arr[i];
    }
    f = 0;
    cin >> k;
    x = 0;
    while (k > 0) {
      if (k % 2 == 1) {
        y = 1;
        for (i = x; i >= 0; i--) {
          if (arr1[i] == 0) {
            continue;
          }
          if (y <= arr1[i]) {
            arr1[i] -= y;
            y = 0;
            break;
          } else {
            y = y - arr1[i];
            arr1[i] = 0;
            y = y * 2;
          }
        }
        if (y > 0) {
          f = 1;
          break;
        }
      }
      k /= 2;
      x++;
    }
    if (f == 1) {
      cout << -1 << endl;
      continue;
    }
    z = 0;
    for (i = 0; i < 25; i++) {
      z = z + (arr[i] - arr1[i]);
    }
    cout << z << endl;
  }
}
