N=int(input())
L=list(map(int,input().split()))
a=L[0]
R=list(set(L))
if len(R)>3:
  print("No")
  exit()
if len(R)==3:
  if R[0]^R[1]!=R[2]:
    print("No")
  else:
    if N%3==0:
      print("Yes")
    else:
      print("No")
elif len(R)==2:
  print("No")
elif len(R)==1:
  if R[0]==0:
    print("Yes")
    exit()
  else:
    print("No")