#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, q;
  cin >> n >> q;
  vector<long long int> a(n), k(q);
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      cin >> a[i];
    } else {
      long long int p;
      cin >> p;
      a[i] = a[i - 1] + p;
    }
  }
  for (int i = 0; i < q; i++) {
    cin >> k[i];
  }
  for (int i = 0; i < q; i++) {
    long long int x = k[i];
    if (x >= a[n - 1]) {
      cout << n << endl;
    } else if (x < a[0]) {
      cout << n << endl;
      k[i + 1] = k[i + 1] + x;
    } else {
      int l = 0, r = n - 1;
      while (l <= r) {
        int m = l + (r - l) / 2;
        if (x == a[m]) {
          if (i + 1 < q) {
            k[i + 1] = k[i + 1] + x;
          }
          cout << (n - m - 1) << endl;
          break;
        } else if (x < a[m] && x >= a[m - 1]) {
          if (i + 1 < q) {
            k[i + 1] = k[i + 1] + x;
          }
          cout << (n - m) << endl;
          break;
        } else if (x < a[m] && x < a[m - 1]) {
          r = m - 1;
        } else if (x > a[m]) {
          l = m + 1;
        }
      }
    }
  }
  return 0;
}
