import sys
from collections import deque

readline = sys.stdin.readline

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


x = A[0]
y, z = x, x
for a in A:
    if a != x:
        y = a
        break
for a in A:
    if a != x and a != y:
        z = a
        break

if x != y and x != z:
    if N % 3 == 0:
        cx, cy, cz = A.count(x), A.count(y), A.count(z)
        if cx + cy + cz == N:
            if cx == cy and cx == cz and ((x ^ z == y) or (x ^ y == z)):
                print('Yes')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')
else:
    if x == y:
        if x == 0:
            print('Yes')
        else:
            print('No')
    else:
        print('No')