from bisect import bisect_right from itertools import accumulate n, q = map(int, input().split()) t = list(accumulate(map(int, input().split()), initial=0)) for _ in range(q): x = int(input()) print(bisect_right(t, x) - 1)