n = int(input())
a = list(map(int, input().split()))
A = set(a)
if A == (0):
    ans = "Yes"
elif len(A) == 2 and 0 in A:
    b = list(A)
    if a.count(b[1]) == (2*n // 3) :
        ans = "Yes"
elif len(A) == 3:
    b = list(A)
    if b[0]^b[1]^b[2] == 0:
        if a.count(b[0]) == n//3 and a.count(b[1]) == n//3 and a.count(b[2]) == n//3:
            ans = "Yes"
else:
    ans = "No"

print(ans)