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)
  a=N//3
  if B[2*a-1]==0:
    print('Yes')
    exit()
  if B[a-1]^B[2*a-1]^B[3*a-1]==0 and len(set(B))==3:
    print('Yes')
  else:
    print('No')