N = int(input())
A = list(map(int, input().split()))
 
s = set(A)
sl = sorted(list(s))

if len(s) == 1 and sl[0] == 0:
  print("Yes")
  exit(0)
elif N%3==0 and len(s)==2 and A.count(sl[1])==2*N//3 and A.count(sl[0])==N//3 and sl[0]==0:
  print("Yes")
  exit(0)
for i in range(N):
    post_index = i + 1 if i + 1 <= (N - 1) else 0
    pre = A[i - 1]
    post = A[post_index]
    if (pre ^ post) != A[i]:
        print("No")
        exit(0)
 
print("Yes")