#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
int main() {
  int n, q, coin_value;
  cin >> n >> q;
  vector<int> powers_ct(32, 0), coins(n, 0);
  for (int i(0); i < (n); i++) {
    cin >> coins[i];
  }
  sort((coins).begin(), (coins).end());
  int p = 0, v = 1;
  for (int i(0); i < (n); i++) {
    while (v != coins[i]) {
      p++;
      v *= 2;
    }
    powers_ct[p]++;
  }
  int x;
  for (int l(0); l < (q); l++) {
    vector<bool> setb(32, 0);
    vector<int> temp(32, 0), temp2(32, 0);
    temp = powers_ct;
    temp2 = powers_ct;
    cin >> x;
    p = 1;
    for (int k(0); k < (32); k++) {
      if (x & p) {
        setb[k] = 1;
      }
      p = (p << 1);
    }
    bool flag = 1;
    int ans = 0;
    for (int i(0); i < (30); i++) {
      if (temp[i] >= 2 && setb[i] == 0) {
        if (temp[i] % 2 == 0) {
          temp[i + 1] += (temp[i] / 2);
          temp[i] = 0;
        } else {
          temp[i + 1] += (temp[i] - 1) / 2;
          temp[i] = 1;
        }
      } else if (temp[i] >= 2 && setb[i] == 1) {
        temp[i] -= 1;
        if (temp[i] % 2 == 0) {
          temp[i + 1] += (temp[i] / 2);
          temp[i] = 0;
        } else {
          temp[i + 1] += (temp[i] - 1) / 2;
          temp[i] = 1;
        }
        if (powers_ct[i] >= 1) {
          ans++;
        } else {
          int val = 0, get = pow(2, i);
          int j = i - 1;
          while (j >= 0) {
            int cur = temp2[j] * pow(2, j);
            if (val + cur > get) {
              ans += (get - val) / (pow(2, j));
              temp2[j] -= (get - val) / (pow(2, j));
              break;
            }
            val += cur;
            ans += temp2[j];
            temp2[j] = 0;
            if (val == get) {
              break;
            }
            j--;
          }
        }
      } else if (setb[i] == 1 && temp[i] == 0) {
        flag = 0;
        break;
      } else if (setb[i] == 1 && temp[i] == 1) {
        if (powers_ct[i] >= 1) {
          ans++;
        } else {
          int val = 0, get = pow(2, i);
          int j = i - 1;
          while (j >= 0) {
            int cur = temp2[j] * pow(2, j);
            if (val + cur > get) {
              ans += (get - val) / (pow(2, j));
              temp2[j] -= (get - val) / (pow(2, j));
              break;
            }
            val += cur;
            ans += temp2[j];
            temp2[j] = 0;
            if (val == get) {
              break;
            }
            j--;
          }
        }
        temp[i] = 0;
      }
    }
    if (flag == 0) {
      cout << "-1\n";
    } else {
      cout << ans << "\n";
    }
  }
  return 0;
}
