#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b) {
  long long c, d;
  if (b == 1) {
    return a % 1000000007;
  } else if (b % 2 == 0) {
    c = power(a, b / 2);
    return (c * c) % 1000000007;
  } else {
    c = power(a, b / 2);
    d = (c * c) % 1000000007;
    d = (d * a) % 1000000007;
    return d;
  }
}
void ha() { printf("YES\n"); }
void na() { printf("NO\n"); }
int main() {
  map<int, int> mp;
  vector<pair<int, int> > a;
  int n, t, i, j, ii, jj;
  scanf("%d %d", &n, &t);
  for (i = 0; i < n; i++) {
    scanf("%d", &j);
    mp[j]++;
  }
  map<int, int>::iterator it = mp.begin();
  for (it = mp.begin(); it != mp.end(); it++) {
    i = it->first;
    j = it->second;
    a.push_back(make_pair(i, j));
  }
  int m = a.size();
  int w, flag = 0;
  while (t--) {
    scanf("%d", &w);
    flag = 0;
    for (i = m - 1; i >= 0; i--) {
      j = min(a[i].second, w / a[i].first);
      w -= (j * a[i].first);
      flag += j;
    }
    if (w) {
      printf("-1\n");
    } else {
      printf("%d\n", flag);
    }
  }
  return 0;
}
