#include int main() { using namespace std; cin.tie(nullptr)->sync_with_stdio(false); int n; cin >> n; int64_t k; cin >> k; --k; vector a(n); for (auto&& e : a) cin >> e; a.push_back(accumulate(begin(a), end(a), int64_t(0), bit_xor{})); ++n; cout << a[k % n] << '\n'; }