import numpy as np
import copy
import itertools

s = input().split()
N=int(s[0])
s = input().split()
a=[]
a=copy.copy(s)
count=0
l=list(itertools.permutations(s,N-1))
if N>3:
    for j in range(1,N):
        s=l[j]
        n=len(s)
        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
else:
    if (int(s[0]) == int(s[1]) ^ int(s[2])) & (int(s[1]) == int(s[0]) ^ int(s[2])) & (int(s[2]) == int(s[1]) ^ int(s[0])):
        count =3
    if count==N :
        print('True')
if count != N:
    print('False')


