n=int(input())
a=list(map(int, input().split(" ")))
if n % 3 != 0:
  print("No")
else:
  ass = list(set(a))
  if a.count(ass[0]) != n // 3 or a.count(ass[1]) != n // 3 or a.count(ass[2]) != n // 3:
    print("No")
  else:
    if ass[0] ^ ass[1] != ass[2]:
      print("No")
    else:
      print("Yes")