#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define MOD 1000000007 int main() { int n, q; cin >> n >> q; 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]; } while (q--) { int l, r; cin >> l >> r; cout << (s[r] ^ s[l - 1]) << endl; } return 0; }