
import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline
mii=lambda:map(int,input().split())

n=int(input())

a=list(mii())
a.sort()

if a[0]==a[n-1]:
    if 0 in b:
        print("Yes")
    else:
        print("No")
elif n%3:
    print("No")
else:
    a1,a2,a3=a[0],a[n//3],a[n//3*2]
    if a1!=a[n//3-1] or a2!=a[n//3*2-1] or a3!=a[n-1]:
        print("No")
    elif a1^a2!=a3 or a1^a3!=a2 or a2^a3!=a1:
        print("No")
    else:
        print("Yes")




