#include<stdio.h>

#define ElementType long long
#define MAX 200010
#define str "%lld"
#define doubleStr "%lld %lld"

int main()
{
	ElementType N, K;
	ElementType i;
	ElementType count;
	ElementType	A[MAX];

	scanf(doubleStr, &N, &K);

	for (i = 1 ; i <= N ; i++)
	{
		scanf(str, &A[i]);
	}

	for (i = 1, count = 0 ; i != 1  || count == 0 ; count++)
	{
		i = A[i];
	}

	K %= count;

	for (count = 0 ; count < K ; count++)
	{
		i = A[i];
	}

	printf(str, i);

	return 0;
}