_=int(input())
*a,=map(int,input().split())
s=list(set(a))
if len(s)==1 and 0 in s:
  ans="Yes"
elif len(s)==2 and 0 in s and a.count(s[0])==a.count(s[1]):
  ans="Yes"
elif len(s)==3 and a.count(s[0])==a.count(s[1])==a.count(s[2]) and s[0]^s[1]^s[2]==0:
  ans="Yes"
else:
  ans="No"
print(ans)