import sys
input = sys.stdin.readline

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

from collections import Counter
C=Counter(A)

flag=1

if len(C)!=3:
    flag=0

if N%3!=0:
    flag=0

for v in C.values():
    if v!=N//3:
        flag=0

A=0
for k in C.keys():
    A^=k

if A!=0:
    flag=0

if flag==1:
    print("Yes")
else:
    print("No")
