#include <bits/stdc++.h>
typedef long long ll;

using namespace std;

ll 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] << '\n';
    return 0;
}