n,a=int(input()),sorted(list(map(int,input().split())));b=set(a);l=len(b)
if l!=3:print("Yes"if(l==1and a[0]==0)or(l==2and a[0]==0and n%3==0and a[n//3-1]!=a[n//3])else"No")
elif:print("Yes"if b.pop()^b.pop()==b.pop()and n%3==0and a[n//3-1]!=a[n//3]and a[n//3*2-1]!=a[n//3*2]else"No")