n=int(input())
a=list(map(int,input().split()))
b=list(set(a))
if len(b)>3:
  print("No")
elif len(b)==3:
  if b[0]^b[1]^b[2]==0:
    if a.count(b[0])==a.count(b[1]) and a.count(b[1])==a.count(b[2]):
      print("Yes")
    else:
      print("No")
  else:
    print("No")
elif len(b)==2:
  b=sorted(b)
  if b[0]==0:
    if a.count(b[0])==2*n//3 and a.count(b[1])==n//3:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
else:
  if b[0]==0:
    print("Yes")
  else:
    print("No")