from enum import Enum
from queue import Queue
import collections

import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001

N = int(input())
A = list(map(int,input().split()))
flag = True
#0番目について判定（１とN-1）
if A[0] != (A[1]^A[N-1]):
    flag = False
#i番目について判定(0,2 ~ N-3,N-1)
for i in range(1,N-1):
     if A[i] != (A[i-1]^A[i+1]):
         flag = False
if A[N-1] != (A[N-2]^A[0]):
    flag = False

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