n=int(input())
al=list(map(int,input().split()))
s=set(al)
s=sorted(s)
if len(s)==1 and s[0]==0:
    print('Yes')
    exit()
if len(al)%3>0 or len(s)>3 or len(s)==1:
    print('No')
    exit()
if len(s)==2 and s[0]==0:
    if al.count(0)==n//3:
        print('Yes')
        exit()
if (s[0]^s[1]^s[2])==0:
    if al.count(s[0])==n//3 and al.count(s[1])==n//3:
        print('Yes')
        exit()
print('No')