#include <stdio.h>

int main(){
  int N, i;
  long int K, j;
  int A[200000],B[200000];
  
  scanf("%d %ld",&N,&K);
  for (i = 0; i < N ; i++){
    scanf("%d",&A[i]);
  }
  
  B[0] = 1;
  
  for(i = 1; i <= N ; i++){
    B[i] = A[ B[i-1] - 1];
  }
  
  j = K % N;
    
  printf("%d",B[j+1]);
  
  return 0;
  
  
}