from collections import  Counter

n=int(input())
a=list(map(int,input().split()))
a.sort()

tmp=Counter(a)
if len(tmp)>3:
    print("No")
    exit()

if len(tmp)==1:
    if not 0 in a:
        print("No")
    else:
        print("Yes")
elif len(tmp)==2:
    if tmp['0']==n//3 :
        print("Yes")
    else:
        print("No")
else:
    values, counts=zip(*tmp.most_common())
    if counts[0]==counts[1]==counts[2] and values[0]^values[1]^values[2]==0:
        print("Yes")
    else:
        print("No")