#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, q;
  cin >> n >> q;
  vector<long long int> a, b, c, cnow;
  long long int i, j, tot = 0;
  for (i = 0; i < n; i++) {
    cin >> j;
    tot += j;
    c.push_back(tot);
  }
  for (i = 0; i < q; i++) {
    cin >> j;
    b.push_back(j);
  }
  long long int now, l, r, mid;
  cnow = c;
  now = 0;
  for (i = 0; i < q; i++) {
    now += b[i];
    l = 0;
    r = n - 1;
    if (now >= cnow[n - 1]) {
      cout << n << endl;
      now = 0;
    } else {
      while (l != r) {
        mid = (l + r) / 2;
        if (now < cnow[mid])
          r = mid;
        else
          l = mid + 1;
      }
      if (now < cnow[mid]) {
        cout << n - mid << endl;
      } else {
        cout << n - mid - 1 << endl;
      }
    }
  }
  return 0;
}
