package main

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

var rdr = bufio.NewReaderSize(os.Stdin, 10000)

func readLine() string {
	buf := make([]byte, 0, 10000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func atoi(s string) int {
	i, _ := strconv.Atoi(s)
	return i
}

func readInt() int {
	return atoi(readLine())
}

func readInts() []int {
	in := readLine()
	ins := strings.Split(in, " ")
	out := make([]int, len(ins))
	for i, v := range ins {
		out[i] = atoi(v)
	}
	return out
}

func judge(a []int) bool {
	for i := 0; i < len(a); i++ {
		if i == 0 {
			if a[0] != a[len(a)-1]^a[1] {
				return false
			}
		} else if i == len(a)-1 {
			if a[len(a)-1] != a[i-1]^a[0] {
				return false
			}
		} else {
			if a[i] != a[i-1]^a[i+1] {
				return false
			}
		}
	}
	return true
}

func main() {
	n := readInt()
	a := readInts()

	var count int
	for i := 0; i < n; i++ {
		if a[i] == 0 {
			count++
		}
	}
	if count == n {
		fmt.Println("Yes")
		return
	}
	if n%3 != 0 {
		fmt.Println("No")
		return
	}

	x := a[0]
	y := a[1]
	z := x ^ y
	var xc, yc, zc int
	for j := 0; j < n; j++ {
		if x == a[j] {
			xc++
		}
		if y == a[j] {
			yc++
		}
		if z == a[j] {
			zc++
		}
	}

	if xc == yc && yc == zc && zc == xc {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}
