#include <bits/stdc++.h>
using namespace std;
long long n,k,a[1000006];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    freopen("CAU1.INP","r",stdin);
    freopen("CAU1.OUT","w",stdout);
    cin>>n>>k;
    for(int i=1;i<=n;i++)
        cin>>a[i];
    cout<<a[k%n+1];
    return 0;
}
