#include <cstdio>

#define rep(i, n) for(int i=0; i<(n);i++)
typedef long long ll;

int next[70][200008];
int main() {
  int N;
  ll K;
  scanf("%d%lld", &N, &K);
  rep(i, N) {
    scanf("%d", &next[0][i]);
    next[0][i]--;
  }
  rep(j, 69) {
    rep(i, N) {
      next[j+1][i]=next[j][next[j][i]];
    }
  }
  int cur = 0;
  rep(j, 70) {
    if(K%2) cur = next[j][cur];
    K/=2;
  }
  printf("%d\n", cur + 1);
  return 0;
}
