a = [input() for i in range(2)]

N = int(a[0])
data = a[1].split(' ')

data = [int(i) for i in data]

result = []
for i in range(N):
    for j in range(N):
        if i <= j:
            continue
        result.append(data[i] ^ data[j])
        
sorted_data = data.sort()
sorted_result = result.sort()

if sorted_data == sorted_result:
    print('Yes')
    
print('No')

        
        
    