package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a[i])
	}

	if n%3 != 0 {
		fmt.Println("No")
		return
	}

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

	fmt.Println("Yes")
}
