#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 9;
long long a[maxn], b[maxn];
long long sum[maxn];
long long ans = 0;
int n, q;
int main() {
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (i == 1)
      sum[i] = a[i];
    else
      sum[i] = sum[i - 1] + a[i];
  }
  int le = 1;
  long long tot = 0;
  for (int i = 1; i <= q; i++) {
    long long x, tmp;
    cin >> tmp;
    x = tmp + tot;
    int t = lower_bound(sum + le, sum + n + 1, x) - sum;
    if (t == n + 1) {
      le = 1;
      cout << n << endl;
      tot = 0;
    }
    if (sum[t] == x && t == n) {
      le = 1;
      cout << n << endl;
      tot = 0;
    } else if (sum[t] == x) {
      le = t + 1;
      cout << n - t << endl;
      tot += tmp;
    } else if (sum[t] > x) {
      le = t;
      cout << n - t + 1 << endl;
      tot += tmp;
    }
  }
  return 0;
}
