import math

n = map(int,input().split())
a = list(map(int, input().split()))
unique_a = list(set(a))


if len(unique_a) == 1 :
    print("Yes")
elif len(unique_a) == 3 :
    if a.count(unique_a[0]) == a.count(unique_a[1]) and  a.count(unique_a[0]) == a.count(unique_a[2]):
        if unique_a[0] == unique_a[1] ^ unique_a[2] or unique_a[1] == unique_a[0] ^ unique_a[2]:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')
