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