package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	var n int
	fmt.Scan(&n)

	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	a := make([]int, n)
	for i := range a {
		sc.Scan()
		a[i], _ = strconv.Atoi(sc.Text())
	}

	for i := range a[:n-2] {
		if a[i]^a[i+1] != a[i+2] {
			fmt.Println("No")
			return
		}
	}
	if a[len(a)-2]^a[len(a)-1] != a[0] {
		fmt.Println("No")
		return
	}
	if a[len(a)-1]^a[0] != a[1] {
		fmt.Println("No")
		return
	}
	fmt.Println("Yes")
}
