function Main(input) {
	const [
      [N, K],
      rowA,
    ] = input.split("\n").map(line => line.split(' ').map(n => BigInt(n)))
    
    let A = rowA.map(a => ({
        next: a,
        firstN: undefined,
    }))

    let first = 0
    let length = 0
    let k = BigInt(1)
    let nextI = BigInt(1)
    let history = []
    while (k <= K) {
        if (A[BigInt(nextI) - BigInt(1)].firstN !== undefined) {
            first = BigInt(k) - A[BigInt(nextI) - BigInt(1)].firstN - BigInt(1)
            length = BigInt(k) - BigInt(first) - BigInt(1)
            break
        }
        history.push(BigInt(nextI))
        length = BigInt(k)
      
        A[BigInt(nextI) - BigInt(1)].firstN = BigInt(k)
        nextI = A[BigInt(nextI) - BigInt(1)].next
        k = BigInt(k) + BigInt(1)
    }

    console.log(Number(history[(K - first) % length + first]))
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"))