n=int(input())
A=[int(i) for i in input().split()]
A.sort()
ans=-1
if n%3!=0:
  ans=0
elif A[0]+A[n-1]==0:
  ans=1
elif A[0]+A[int((n/3))-1]==0 and A[int((n/3))]==A[n-1]:
  ans=1
elif A[0]!=A[int(n/3)] and A[int(n/3)]!=A[n-1] and A[0]==A[int(n/3)-1] and A[int(n/3)]==A[int(n/3)*2-1] and A[int(n/3)*2]==A[n-1] and A[0]^A[int(n/3)]^A[n-1]==0:
  ans=1
if ans==1:
  print("Yes")
else:
  print("No")
