n=int(input())
l=list(map(int,input().split()))
l.sort()
l1=l+[l[0]]
l2=[l[1],l[0]]+l[2:]+[l[1]]
flag=0
for i in range(1,n):
  if (l1[i-1]^l1[i+1])!=l1[i]:
    flag=1
    break
if flag==1:
  for i in range(1,n):
    if (l2[i-1]^l2[i+1])!=l2[i]:
      flag=1
      break    
if flag==0:print("Yes")
else:print("No")
