N = int(input())
a = [int(i) for i in input().split()]
a.sort()
count = 0
for i in range(len(a)):
    if i == 0:
        left = -1
        right = i + 1
    elif i == len(a) - 1:
        left = i - 1
        right = 0
    else:
        left = i - 1
        right = i + 1

    number = bin(a[left] ^ a[right])
    if bin(a[i]) != number:
        print('No')
        break
    else:
        count += 1

if count == len(a):
    print('Yes')
