from collections import Counter

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

if N % 3:
    ans = all(a == 0 for a in A)
else:
    c = Counter(A)
    if len(c) != 3:
        ans = False
    else:
        x, y, z = c.keys()
        ans = (c[x] == c[y] == c[z]) and (x ^ y == z)
print('Yes' if ans else 'No')
