import collections

N=int(input())
l=list(map(int,input().split()))
c=collections.Counter(l)
cv=list(c.values())
ck=list(c.keys())
if len(cv) == 3 and cv[0] == cv[1] and cv[1] == cv[2] and ck[0]==ck[1]^ck[2]:
    print("Yes")
elif len(cv) == 2 and ((cv[0] == cv[1]*2 and ck[0]==0) or (cv[1] == cv[0]*2 and ck[1]==0)):
    print("Yes")
elif len(cv) == 1 and ck[0] == 0:
    print("Yes")
else:
    print("No")
