import collections 

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

counter = collections.Counter(input_list)


unique_list = list(counter.keys())
counts = list(counter.values())

if (all(num == 0 for num in unique_list)):
    print('Yes')
else:
    if len(counter) != 3:
        print('No')
    if (unique_list[0] ^ unique_list[1] == unique_list[2]):
        if (all(counts[0] == num for num in counts)):
            print('Yes')
    print('No')