n = int(input())
a = list(map(int,input().split()))

flagF = 0
flagL = 0
flagT = 0

for i in range(n):
    if(i==0):
        if((a[i+1]^a[n-1])==a[i]):
            flagF = 1
        else:
            break
    elif(i==(n-1)):
        if((a[0]^a[i-1])==a[i]):
            flagL = 1
        else:
            break
    elif(0<i<n-1):
        if((a[i-1]^a[i+1])==a[i]):
            flagT = 1
        elif(a[i-1]^a[i+1]!=a[i]):
            flagT = 0
            break
if(flagF==1 and flagL==1 and flagT==1):
    print("Yes")
else:
    print("No")