import collections
N=int(input())
a=list(map(int,input().split()))
if (N%3)==0:
    c=collections.Counter(a)
    l=list(set(a))
    if ((len(l)==3)and(c[l[0]]==c[l[1]]==c[l[2]])and(l[0]^l[1]==l[2]))or((len(l)==1)and(l[0]==0)):
        print("Yes")
    else:
        print("No")
else:
    if max(a)==0:
        print("Yes")
    else:
        print("No")