#include #include void solve() { int n, q; std::cin >> n >> q; std::vector xs(n + 1, 0); for (int i = 0; i < n; ++i) { int x; std::cin >> x; xs[i + 1] = xs[i] ^ x; } while (q--) { int l, r; std::cin >> l >> r; std::cout << (xs[l - 1] ^ xs[r]) << "\n"; } } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }