#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; const int MOD=998244353; bool is_nCk_odd(int n, int k){ return (n&k)==k; } ll modpow(ll x,ll n){ ll ans=1; while(n){ if(n&1) ans=ans*x%MOD; x=x*x%MOD; n/=2; } return ans; } int main() { ios::sync_with_stdio(false); std::cin.tie(nullptr); int n; cin>>n; vector B(n); rep(i,n) cin>>B[i]; int now=0; ll cnt=0,bnt=0; rep(i,n){ if(is_nCk_odd(n-1,i)){ if(B[i]>=0) now^=B[i]; else cnt++; } else{ if(B[i]==-1) bnt++; } } if(now==0 && cnt==0){ cout<<0<