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

top = a[0]
if top == 0:
    if a.count(0) == n:
        print("Yes")
        exit()
    else:
        print("No")
        exit()

las_i = -1
for i in range(len(a)):
    if a[i] == las_i:
        continue
    for j in range(i+1, len(a)):
        if top == a[i]^a[j]:
            las_i = a[i]
            if (a.count(top) == a.count(a[i]) == a.count(a[j]) 
                and a.count(top) + a.count(a[i]) + a.count(a[j]) == n):
                print("Yes")
                exit()
            break

print("No")