#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 50;
long long suma[MAXN];
inline long long read() {
  long long res = 0;
  char ch;
  ch = getchar();
  while (48 > ch || ch > 57) ch = getchar();
  while (48 <= ch && ch <= 57) {
    res = (res << 3) + (res << 1) + ch - 48;
    ch = getchar();
  }
  return res;
}
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n; i++) {
    long long t;
    t = read();
    if (!i)
      suma[i] = t;
    else
      suma[i] = suma[i - 1] + t;
  }
  long long sumk = 0;
  while (q--) {
    long long k;
    k = read();
    long long *pos = lower_bound(suma, suma + n - 1, sumk + k);
    if (*pos > sumk + k) {
      pos--;
    }
    if (pos - suma == n - 1) {
      sumk = 0;
      printf("%d\n", n);
    } else {
      printf("%d\n", n - (pos - suma + 1));
      sumk += k;
    }
  }
  return 0;
}
