import collections

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

C = collections.Counter(a)
L = len(C)
e = list(C.keys())
if L == 1:
    print((C[0] > 0) and "Yes" or "No")
elif L == 2:
    if C[e[0]] == C[e[1]] * 2:
        print(((e[0] ^ e[0] == e[1]) or (e[1] ^ e[1] == e[0])) and "Yes" or "No")
    else:
        print("No")
elif L == 3:
    if (C[e[0]] == C[e[1]]) and (C[e[1]] == C[e[2]]):
        print(((e[0] ^ e[1]) == e[2]) and "Yes" or "No")
    else:
        print("No")
else:
    print("No")
