#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); int N,Q; cin >> N >> Q; vector a(N); rep(i,N) cin >> a[i]; vector s(N + 1, 0); rep(i,N) s[i + 1] = (s[i] ^ a[i]); rep(_,Q) { int L, R; cin >> L >> R; L--; cout << (s[R] ^ s[L]) << "\n"; } }