#include using namespace std; const int64_t inf = 1e18; const int64_t mod = 998244353; // const int64_t mod = 1000000007; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; int tt; cin >> tt; vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } vector s(n+1); s[0] = 0; for (int i = 0; i < n; i++) { s[i+1] = s[i]^a[i]; } for (;tt--;) { int l, r; cin >> l >> r; l--; cout << (s[l]^s[r]) << endl; } }