#include <bits/stdc++.h>
using namespace std;
int checkVal(int val, int *start) {
  int counter = 0;
  for (int i = 30; i >= 0; i--) {
    int digit = (1 << (i));
    if (val >= digit && *(start + i) > 0) {
      counter +=
          ((val / digit) > (*(start + i)) ? (*(start + i)) : (val / digit));
      val -= ((val / digit) > (*(start + i)) ? (*(start + i)) : (val / digit)) *
             digit;
    }
  }
  return val == 0 ? counter : -1;
}
int main() {
  int n, k;
  scanf("%d", &n);
  scanf("%d", &k);
  int arr[31];
  for (auto &i : arr) i = 0;
  for (int i = 0; i < n; i++) {
    int key;
    scanf("%d", &key);
    int temp = log10(key) / log10(2);
    arr[temp]++;
  }
  for (int i = 0; i < k; i++) {
    int val;
    scanf("%d", &val);
    printf("%d", checkVal(val, arr));
    printf("%s", "\n");
  }
  return 0;
}
