import sys
#input = sys.stdin.readline
from collections import Counter
def inpl(): return list(map(int, input().split()))

N = int(input())
A = inpl()
C = Counter(A)
K = list(C.keys())

if len(K) != 3 or not (C[K[0]] == C[K[1]] ==C[K[2]]):
    print("No")
else:
    if K[0] ^ K[1] == K[2]:
        print("Yes")
    else:
        print("No")
