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