n=int(input())
l3 = list(map(int,input().split()))
l = set(l3)
l2 = list(l)
if n % 3 != 0:
    print("No")
elif len(l) != 3:
  if len(l)==1 and l2[0]==0:
    print("Yes")
  elif len(l)==2:
    if l3.count(l2[0])//l3.count(l2[1])==2:
      if l2[0]^l2[1]==l2[0] and l2[0]^l2[0]==l2[1]:
        print("Yes")
      else:
        print("No")
    elif l3.count(l2[1])//l3.count(l2[0])==2:
      if l2[1]^l2[0]==l2[1] and l2[1]^l2[1]==l2[0]:
        print("Yes")
      else:
        print("No")
    else:
      print("No")
  else:
    print("No")
else:
    if (l2[0] ^ l2[1] == l2[2]) and (l2[1] ^ l2[2] == l2[0]) and (l2[2] ^ l2[0] == l2[1]):
        print("Yes")
    else:
        print("No")


