#include <stdio.h>

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