import collections


N = int(input())
a = list(map(int, input().split()))
C = collections.Counter(a)
L = len(C)
e = list(C.keys())
print(
    (
        ((L == 1) and (C[0] > 0))
        and ((L == 2) and (C[0] > 0) and (C[e[0]] * 2 == C[e[1]]))
        and ((L == 3) and (C[e[0]] == C[e[1]] == C[e[2]]) and ((e[0] ^ e[1]) == e[2]))
    )
    and "Yes"
    or "No"
)

