#include<bits/stdc++.h>
using namespace std;
int a[1000001];
int main()
{
    freopen("cau1.inp","r",stdin);
    freopen("cau1.out","w",stdout);
    int n,k;
    cin>>n>>k;
    for(int i=1;i<=n;i++)
        cin>>a[i];
    cout<<a[k%n+1];
}
