object Main {
  def main(args:Array[String]) = {
   // val seq = readLine.split("")
    val input=io.Source.stdin.getLines().mkString("\n")
   // println(solve(input).toString.trim())
    val a = input.split("\n")
    println(solve(a(0),a(1)).toString.trim())
   // print(input)
  }
 
 def solve(aaa:String,bbb:String): Int={
  var ctm = aaa.split(" ")(0).toInt + 1
  var gl = aaa.split(" ")(1).toInt
  val parr= bbb.split(" ").map(_ .toInt)
  var ps =0
  var ct =0
  for(i<-0 until ctm){
  	if(ps <= gl){
    	ps = ps + parr(i)
       ct =i
    }
  }
  ct+1
}
}