import std.stdio, std.conv, std.string, std.algorithm,
       std.math, std.array, std.container, std.typecons;

long n, k;
long[] a;
bool[long] appear;

long next(long x) {
  return a[x-1];
}

void main() {
  readf("%d %d\n", &n, &k);
  a = readln.chomp.split.to!(long[]);
  long i=1;
  long j=0;
  while(!appear.get(i,false)) {
    appear[i] = true;
    i = i.next;
    j++;
    k--;
  }
  long beg=i;
  i=i.next;
  long looplen = 0;
  while(beg!=i) {
    i=i.next;
    looplen++;
  }
  long z = k%(looplen+1);
  for(long l=0; l<z; l++) {
    i = i.next;
  }
  i.writeln;
}
