#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
int a[N], n, q, vis[40], cat[40];
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    int cnt = 0;
    while (a[i]) {
      a[i] = a[i] / 2;
      cnt++;
    }
    vis[cnt]++;
  }
  while (q--) {
    int b, ans = 0;
    scanf("%d", &b);
    int cnt = 0, f = 0;
    for (int i = 1; i <= 32; i++) {
      cat[i] = vis[i];
    }
    while (b) {
      cnt++;
      if (b & 1) {
        if (!cat[cnt]) {
          int cn = 2;
          for (int i = cnt - 1; i; i--) {
            if (cat[i]) {
              if (cat[i] >= cn) {
                ans += cn;
                cat[cnt] = 1;
                break;
              } else {
                cn = (cn - cat[i]) * 2;
              }
            }
          }
          if (!cat[cnt]) {
            f = 1;
            break;
          }
        } else {
          ans++;
        }
      }
      b = b / 2;
    }
    if (f) {
      printf("-1\n");
    } else {
      printf("%d\n", ans);
    }
  }
}
