let n, x = Scanf.scanf " %d %d" @@ fun a b -> a, b
let ls = Array.init n @@ fun _ -> Scanf.scanf " %d" (+) 0
let d, i = ref 0, ref 0
let _ = while !d < x do d := !d + ls.(!i); incr i done; Printf.printf "%d\n" @@ !i + if !d = x then 1 else 0