#include using namespace std; int main() { int N, Q; cin >> N >> Q; vector a( N ); for( int i = 0; i < N; i++ ) { cin >> a[i]; } vector acc( N + 1 ); for( int i = 0; i < N; i++ ) { acc[i + 1] = acc[i] ^ a[i]; } for( int i = 0; i < Q; i++ ) { int l, r; cin >> l >> r; int ans = acc[r] ^ acc[l - 1]; cout << ans << endl; } }