#include <bits/stdc++.h>
using namespace std;
inline long long int power(long long int x, long long int y) {
  long long int res = 1;
  x = x % 1000000007;
  while (y > 0) {
    if (y & 1) res = (res * x) % 1000000007;
    y = y >> 1;
    x = (x * x) % 1000000007;
  }
  return res % 1000000007;
}
inline long long int sum(long long int a, long long int b,
                         long long int m = 1000000007) {
  b = ((b % m) + m) % m;
  a = ((a % m) + m) % m;
  return ((a + b) % m + m) % m;
}
inline long long int mul(long long int a, long long int b,
                         long long int m = 1000000007) {
  b = ((b % m) + m) % m;
  a = ((a % m) + m) % m;
  return ((a * b) % m + m) % m;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n, q;
  cin >> n >> q;
  vector<long long int> A(n);
  vector<long long int> pre(n);
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    pre[i] = A[i];
    if (i > 0) pre[i] += pre[i - 1];
  }
  long long int curr = 0;
  while (q--) {
    long long int k;
    cin >> k;
    long long int num = curr + k;
    int ind = (int)(lower_bound((pre).begin(), (pre).end(), num) - pre.begin());
    if (ind == n - 1 && num == pre[ind]) ind++;
    if (ind == n) {
      cout << n << "\n";
      curr = 0;
    } else {
      if (pre[ind] == num) ind++;
      cout << n - ind << "\n";
      curr = num;
    }
  }
  return 0;
}
