N=int(input())
A=list(map(int, input().split()))

if N%3!=0:
  if A==[0]*N:
    print('Yes')
  else:
    print('No')
else:
  B=sorted(A)
  print(B)
  a=N//3
  if B[2*a-1]==0:
    print('Yes')
  else:
    if len(set(B))!=3:
      print('No')
    else:
      C=list(set(B))
      C=sorted(C)
      C1,C2,C3=C[0],C[1],C[2]
      if C1^C2^C3==0 and B==[C1]*a+[C2]*a+[C3]*a:
        print('Yes')
      else:
        print('No')