n=int(input())
l=list(map(int,input().split()))
import collections
c=dict(collections.Counter(l))
d=list(c.values())
e=list(c.keys())
if len(d)==3:
    d.sort()
    e.sort()
    if d[0]==d[1]==d[2] and e[0]^e[2]==e[1]:
        print("Yes")
    else:
        print("No")
elif len(d)==2:
    d.sort()
    e.sort()
    if d[0]==d[1] and e[0]==0:
        print("Yes")
    elif d[0]*2==d[1] and e[0]==0:
        print("Yes")
    else:
        print("No")
else:
    print("No")