#include <bits/stdc++.h>
using namespace std;
void fastscan(int &number) {
  bool negative = false;
  register int c;
  number = 0;
  c = getchar();
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) number = number * 10 + c - 48;
  if (negative) number *= -1;
}
int main() {
  long long int a, b;
  cin >> a >> b;
  long long int arr[a];
  long long int n = a;
  long long int sum = 0;
  map<long long int, long long int> mp;
  set<long long int> s;
  for (long long int i = 0; i < a; i++) {
    cin >> arr[i];
    sum += arr[i];
    s.insert(arr[i]);
    mp[arr[i]]++;
  }
  for (long long int i = 0; i < b; i++) {
    long long int x;
    cin >> x;
    if (x > sum) {
      cout << -1 << '\n';
      continue;
    }
    if (x == sum) {
      cout << n << '\n';
      continue;
    }
    long long int ans = 0;
    auto p = s.upper_bound(x);
    p--;
    while (x >= 0 && x >= *s.begin()) {
      long long int w = x / (*p);
      w = min(mp[*p], w);
      ans += w;
      x -= *p * w;
      if (p == s.begin()) {
        break;
      }
      p--;
    }
    if (x) {
      cout << -1 << '\n';
    } else {
      cout << ans << '\n';
    }
  }
  return 0;
}
