#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)s; i < (int)e; ++i) #define all(a) (a).begin(),(a).end() int main() { cin.tie(nullptr); int N, Q; cin >> N >> Q; vector A(N); rep(i, 0, N) cin >> A[i]; rep(i, 1, N) A[i] ^= A[i - 1]; rep(query, 0, Q) { int L, R; cin >> L >> R; L--, R--; if (L == 0) cout << A[R] << '\n'; else cout << (A[R] ^ A[L - 1])<< '\n'; } }