import itertools
import sys

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

for i in itertools.permutations(a[1:], len(a)-1):
    flag = True
    i = list(i)
    i.append(a[0])
    i.append(i[0])
    i.insert(0, a[0])
    for j in range(0, len(i)-2):
        if i[j] ^ i[j+2] != i[j+1]:
            flag = False
    if flag:
        print("Yes")
        sys.exit()

print("No")
