N = int(input())
A = [int(i) for i in input().split()]
flag = False

for i in range(1,N-1):
  if A[i] == (A[i-1]^A[i+1]):
    flag = True
if A[0] == (A[-1]^A[1]):
  flag = True
if A[-1] == (A[-2]^A[0]):
  flag = True

if flag:
  print("Yes")
else:
  print("No")