import collections

n=int(input())

a_list = list(map(int, input().split()))
#print(a_list)
c = collections.Counter(a_list)
#print(c)

values=list(c.values())
values.sort()
#print(values)

keys=list(c.keys())
keys.sort()
#print(keys)

ans="No"
if len(values)==3:
  if values[0]==values[1] and values[1]==values[2]:
    if keys[0] ^ keys[1]==keys[2]:
      ans="Yes"
  
if len(values)==2:
  if keys[0] == 0:
    if values[0]*2==values[1]:
      ans="Yes"

  
print(ans)

