inp = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n')
l = inp.shift().split(' ')
N = l.shift() * 1
K = BigInt(l.shift())
l = inp.shift().split(' ')
c = 1
n = 1
k = new Array(l.length)
while (K) {
    if (k[n-1]) {
        K = K % BigInt(c - k[n-1])
        if (K === 0n) {
            break;
        }
    } else {
        k[n-1] = c
        c++
    }
    n = l[n - 1]
    K = K - 1n
}
console.log(n)