#include <bits/stdc++.h>
using namespace std;
vector<int64_t> v;
int32_t main() {
  {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
  };
  int64_t n, q, now = 0, t;
  cin >> n >> q;
  cin >> t;
  v.push_back(t);
  for (int64_t i = 1; i < n; i++) {
    cin >> t;
    v.push_back(v.back() + t);
  }
  for (int64_t i = 0; i < q; i++) {
    cin >> t;
    now += t;
    if (now >= v.back()) {
      cout << v.size() << '\n';
      now = 0;
      continue;
    }
    cout << (int64_t)v.size() -
                (upper_bound(v.begin(), v.end(), now) - v.begin())
         << '\n';
  }
  return 0;
}
