#include <bits/stdc++.h>
using namespace std;
map<long long, long long> b;
int main() {
  int n, q, k;
  scanf("%d %d", &n, &q);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    b[x]++;
  }
  int a = 1 << 30;
  for (int i = 0; i < q; i++) {
    int m;
    int ans = 0;
    int step = 0;
    scanf("%d", &m);
    for (int i = a; i >= 1; i = i / 2) {
      long long q = m / i;
      k = min(b[i], q);
      m -= k * i;
      ans = ans + k;
      if (m == 0) {
        break;
      }
    }
    if (m == 0) {
      printf("%d\n", ans);
    } else {
      printf("-1\n");
    }
  }
}
