package main

import (
    "fmt"
)

func main(){
    var n int
    var flag int = 0
    fmt.Scan(&n)
    a := make([]int64, n)
    for i := 0; i < n; i++ {
        fmt.Scan(&a[i])
    }
    if a[n - 1] ^ a[1] == a[0]{
        for i := 1; i < n - 2; i ++ {
            if a[i - 1] ^ a[i + 1] != a[i] {
                flag = 0;
            }
        }
        if a[n - 2] ^ a[0] == a[n - 1] {
            flag = 1;
        }
    }

    if flag == 1 {
        fmt.Println("Yes")
    } else if flag == 0{
        fmt.Println("No")
    }
}