import sys
import itertools
n=int(input())
l=list(map(int,input().split()))
l.sort()
s=set(l)
if len(s)>=4:print("No");sys.exit()
s=list(s)
flag=0
for i in itertools.permutations(s):
  if i[0]^i[2]==i[1] and i[1]^i[2]==i[0] and i[0]^i[1]==i[2]:flag+=1
if flag==6:print("Yes")
else:print("No")
