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