import Foundation
let arr=readLine()!.split{$0==" "}.map{Int(String($0))!}
var n:Int=arr[0]
var k=arr[1]
var count:[Int] = []
let arr2=readLine()!.split{$0==" "}.map{Int(String($0))!}
for i in 0 ..< n {
    count.append(arr2[i])
}
var h = 0
 
for _ in 0 ..< k/n {
   h = count[h] - 1
}
 
print(h+1)