N = int(input())
a = list(map(int,input().split()))

res = "No"
a_set = list(set(a))

a_set = [i for i in a_set if i != 0]

if len(a_set) == 3:
    if a_set[0] ^ a_set[1] == a_set[2]:
        if a.count(a_set[0]) == a.count(a_set[1]) and a.count(a_set[0]) == a.count(a_set[2]):
            res = "Yes"

print(res)