N=int(input())
arr=list(map(int,input().split()))
def bin30(a):
    s=bin(a)[2:]
    return "0"*(30-len(s))+s
def rotate(arr,i):
    return arr[i:]+arr[:i]
def shrink(arr):
    ret=[]
    i=0
    while i<len(arr):
        tmp = arr[i]
        j=i
        while j<N and arr[j]==tmp:
            j+=1
        ret.append((tmp,j-i))
        i=j
    return ret
barr=[bin30(a) for a in arr]
for bits in zip(*barr):
    i=0
    while i<N and bits[i]=='1': i+=1
    for b,n in shrink(rotate(bits,i)):
        if b=='1' and n%2==1:
            print("No")
print("Yes")
