const Main = input => {
    const inp = input.split("\n");
    const inp2 = inp[0].split(" ");
    const n = parseInt(inp2[0], 10);
    const k = parseInt(inp2[1], 10);
    const a = inp[1].split(" ").map(value => parseInt(value, 10));
    
    //すでにいったかどうか
    const flag = new Array(n);
    flag.fill(false);

    //道筋を求める
    const root = [];
    let now = 1;
    while(true) {
        if(flag[now-1] === true) break;

        flag[now-1] = true;
        root.push(now);
        now = a[now-1];
    }

    const result = k % root.length;
    console.log(root[result]);


}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));