import collections

N = input()
N = int(N)
a = [ int(i) for i in input().split()]
c = collections.Counter(a)
hoge = False

def check(i,j):
    c[j] -= 1
    for k in range(len(a)-1):
        if c[i^j] >= 1:
            return False
        c[i^j]-=1
        i2 = j
        j = i^j
        i = i2
    return True


if check(a[0],a[1]):
    hoge = True

if hoge:
  print("Yes")
else:
  print("No")
