import java.util.Scanner

object Main extends App {
  def readALine(c:Int, ac:List[Int]):List[Int] =
    if (c > 0) readALine(c-1, sc.nextInt::ac) else ac.reverse
  def readLines(r:Int, c:Int, ac:List[List[Int]]):List[List[Int]] =
    if (r > 0) readLines(r-1, c, readALine(c, Nil)::ac) else ac.reverse
  val sc = new Scanner(System.in)
  val N = sc.nextInt
  val K = sc.nextLong
  val ls = readALine(N, Nil)
//  println(ls)

  def analyze():(Int, Int, Int) = {
    val usedTowns = Array.fill(N+1)(0)

    def iter(pos:Int, order:Int):(Int, Int, Int) = {
      if (usedTowns(pos) > 0) (pos, usedTowns(pos)-1, order - usedTowns(pos))
      else {
        usedTowns.update(pos, order)
        iter(ma(pos), order+1)
      }
    }

    iter(1, 1)
  }

  def move(s:Int, t:Int):Int = if (t == 0) s else move(ma(s), t-1)

  val ma = (0::ls).toArray
  val (pos, lead, loop) = analyze()

  // println(s"pos:$pos  lead:$lead  loop:$loop")
  println( if (K < lead) move(1, K.toInt) else move(pos, ((K-lead) % loop).toInt))
}
