import sys
n=int(input())
a=[int(i) for i in input().split()]
if n%3!=0:
  print('No')
  sys.exit()
b=set(a)
if len(b)!=3:
  print('No')
  sys.exit()
if list(b)[0]^list(b)[1]^list(b)[2]!=0:
  print('No')
  sys.exit()
s=[a.count(i) for i in list(b)]
if s[0]==s[1]==s[2]:
  print('Yes')
else:
  print('No')