import numpy as np
import copy

s = input().split()
N=int(s[0])
s = input().split()
a=[]
a=copy.copy(s)
count=0
for k in range(1,N):
    s=copy.copy(a)
    for j in range(1,N):
        t=s[j]
        s[j]=s[k]
        s[k]=s[j]
        for i in range(N):
            if i==0 :
                if int(s[i])==int(s[N-1])^int(s[i+1]):
                    count+=1
            elif i==N-1:
                if int(s[i])==int(s[i-1])^int(s[0]):
                    count += 1
            else:
                if int(s[i])==int(s[i-1])^int(s[i+1]):
                    count += 1
    if count==N:
        print('True')
        break

if count != N:
    print('False')

