import copy
import numpy

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

first = a[0]

for j in range(N-1):
    second = a[j]
    while(len(a) > 2):

        xor = bin(first ^ second)
        check = int(xor,2)

        if (check in a):
            a.remove(second)
            first = a[j]
            second = check

        else:
            break

        if (len(a) == 2):
            print("Yes")
            exit()

print("No")
