#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
void oj() {}
long long binpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  oj();
  long long t = 1;
  while (t--) {
    long long n, q;
    cin >> n >> q;
    vector<long long> a(n), c(q);
    for (long long i = 0; i < n; ++i) {
      cin >> a[i];
    }
    for (long long i = 0; i < q; i++) {
      cin >> c[i];
    }
    vector<long long> pre(n, 0);
    pre[0] = a[0];
    for (long long i = 1; i < n; i++) {
      pre[i] = pre[i - 1] + a[i];
    }
    long long strength = 0;
    for (long long i = 0; i < q; i++) {
      strength += c[i];
      auto it = lower_bound(pre.begin(), pre.end(), strength);
      long long ind = it - pre.begin();
      if (it == pre.end() || pre.back() == strength) {
        strength = 0;
        cout << n << "\n";
      } else if (*it == strength) {
        cout << n - ind - 1 << "\n";
      } else {
        cout << n - ind << "\n";
      }
    }
  }
  return 0;
}
