#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cout << *it << " = " << a << endl;
  err(++it, args...);
}
const int mod = 1e9 + 7;
void solve() {
  int n, q;
  cin >> n >> q;
  vector<long long> arr(n + 1, 0), m(q + 1);
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    arr[i] += arr[i - 1];
  }
  int l = 1, sum = 0;
  for (int i = 1; i <= q; i++) {
    cin >> m[i];
    long long temp = arr[l - 1];
    auto itr = upper_bound(arr.begin(), arr.end(), m[i] + temp + sum);
    if (itr == arr.end()) {
      cout << n << "\n";
      l = 1;
      sum = 0;
    } else {
      int l1 = itr - arr.begin();
      if (l == l1)
        sum += m[i];
      else {
        sum = m[i] + temp + sum - *(--itr);
        l = l1;
      }
      cout << n - l + 1 << "\n";
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  solve();
}
