import numpy as np
import itertools

N = int(input())

a = [int(i) for i in input().split()]

per_1 = list(itertools.permutations(a))


N = N-1
ans = "No"
for i in per_1:
    counting = 0
    if (bin(i[0]) == bin(i[N] ^ i[1])) & (bin(i[N]) == bin(i[0] ^ i[N-1])):

        for j in range(1,N-1):
            if (bin(i[j]) == bin(i[j+1] ^ i[j-1])):
                counting += 1
    
        if counting == N-2:
                ans = "Yes"
print(ans)
                
               
    

        