#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
const int N = 1e3 + 10;
const int M = 2e5 + 10;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int mod = 1e9 + 7;
const int mod2 = 998244353;
const int mod3 = 1e9 + 9;
long long dp[N][N], a[N];
signed main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n, m;
  cin >> n >> m;
  memset(dp, inf, sizeof(dp));
  for (int i = 1; i <= n + 1; i++) {
    dp[i][0] = 0;
  }
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = n; i >= 1; i--) {
    for (int j = 1; j <= n - i + 1; j++) {
      dp[i][j] = min(dp[i + 1][j], max((long long)0, dp[i + 1][j - 1] - a[i]));
    }
  }
  long long x;
  for (int i = 1; i <= m; i++) {
    cin >> x;
    int pos = upper_bound(dp[1] + 1, dp[1] + n + 1, x) - dp[1];
    pos--;
    cout << n - pos << endl;
  }
  return 0;
}
