#include <bits/stdc++.h>
using namespace std;
long long a[50] = {1};
int num[50];
int main() {
  int n, q;
  for (int i = 1; i < 35; i++) {
    a[i] = a[i - 1] * 2;
  }
  memset(num, 0, sizeof(num));
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n; i++) {
    long long k;
    scanf("%lld", &k);
    for (int i = 0; i < 35; i++) {
      if (a[i] == k) {
        num[i]++;
        break;
      }
    }
  }
  for (int i = 0; i < q; i++) {
    long long k;
    scanf("%lld", &k);
    int cnt = 0;
    for (int i = 34; i >= 0; i--) {
      if (k >= a[i] && num[i] > 0) {
        cnt += min(k / a[i], (long long)1 * num[i]);
        k -= min(k / a[i], (long long)1 * num[i]) * a[i];
      }
      if (k == 0) {
        break;
      }
    }
    if (k == 0)
      printf("%d\n", cnt);
    else
      printf("-1\n");
  }
}
