//# pragma GCC target("avx") # pragma GCC optimize("O3") # pragma GCC optimize("unroll-loops") #ifdef LOCAL #define debug(x) cerr << #x << " = " << (x) << endl; #else #define debug(x) #endif #include #include #include #include #define fast ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr) #define eb emplace_back #define all(x) (x).begin(), (x).end() using namespace std; using ll = long long; using namespace __gnu_pbds; #include using namespace atcoder; constexpr ll inf = 2e18; constexpr int mod = 998244353; static void judge(bool c){ cout << (c ? "Yes" : "No") << '\n'; } int n,q,a[200000],l,r,x[200001]; int main() { cin >> n >> q; for(int i = 0; i < n; i++) { cin >> a[i]; x[i + 1] = x[i] ^ a[i]; } while(q--){ cin >> l >> r; cout << (x[r] ^ x[l - 1]) << '\n'; } }