function Main(input) {
	const [
      [rowN, rowK],
      rowA,
    ] = input.split("\n").map(line => line.split(' '))
    
    const N = BigInt(rowN)
    const K = BigInt(rowK)
    
    let A = rowA.map(a => ({
        next: parseInt(a),
        firstN: undefined,
    }))
 
    let first = 0
    let length = 0
    let k = 1
    let nextI = 1
    let history = []
    while (k <= K) {
        if (A[nextI - 1].firstN !== undefined) {
            first = k - A[nextI - 1].firstN - 1
            length = k - first - 1
            break
        }
        history.push(nextI)
        length = k
      
        A[nextI - 1].firstN = k
        nextI = A[nextI - 1].next
        k = k + 1
    }
 
    console.log(history[Number((K - BigInt(first)) % BigInt(length) + BigInt(first))])
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"))