import itertools

N = int(input())
a = list(map(int ,input().split()))

ans = 'Yes'
for l in itertools.permutations(a):
    a_tmp = list(l)
    if a_tmp[0] != a[0]:
        continue
    a_tmp.extend(a_tmp[:2])

    a_plus = [ int(bin(a_tmp[x]^a_tmp[x+2]), 0) for x in range(N) ]
    a_tmp2 = a_tmp[1:-2]
    a_tmp2.append(a_tmp[0])
    if a_tmp2 != a_plus:
        ans = 'No'
        break
print(ans)