#include #include using namespace std; int main(){ int n,q;cin>>n>>q; vector A(n); vector B(n+1); B[0] = 0; for(int i = 0; n > i; i++){ cin>>A[i]; B[i+1] = B[i]^A[i]; } for(int i = 0; q > i; i++){ int x,y;cin>>x>>y; cout << (B[x-1]^B[y]) << endl; } }