import collections
n=int(input())
if n%3!=0:print("No");exit()
l=list(map(int,input().split()))
c=collections.Counter(l)
mc=c.most_common()
if len(mc)<3:print("No");exit()
if mc[0][1]==mc[1][1]==mc[2][1]==n//3:
    a,b,c=mc[0][0],mc[1][0],mc[2][0]
else:print("No");exit()
if a^b==c and b^c==a and c^a==b:
    print("Yes")
else:print("No")