import collections 

n = int(input())
input_list = [int(i) for i in input().split(' ')]

if n % 3 != 0:
    print('No')

counter = collections.Counter(input_list)
if len(counter) != 3:
    print('No')

unique_list = list(counter.keys())
counts = list(counter.values())
if (unique_list[0] ^ unique_list[1] == unique_list[2]):
    if (all(counts[0] == num for num in counts)):
        print('Yes')
print('No')