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