#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 100, inF = 1e17;
long long n, q, t, a[N], k[N], ps[N];
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    ps[i] = ps[i - 1] + a[i];
  }
  for (int i = 0; i < q; i++) cin >> k[i];
  ps[n + 1] = inF;
  int now = 0, hurt = 0;
  for (int i = 0; i < q; i++) {
    int dex = upper_bound(ps, ps + n + 2, k[i] + ps[now] + hurt) - ps;
    hurt = k[i] - (ps[dex - 1] - ps[now] - hurt);
    now = dex - 1;
    if (now == n) now = 0, hurt = 0;
    cout << n - now << '\n';
  }
  return 0;
}
