package main

import "fmt"
import "bufio"
import "os"
import "strconv"
import "sort"

var _sw = bufio.NewScanner(os.Stdin)

func main() {
	N := NextInt()
	A := NextInts(N)

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

	cnts := map[int]int{}
	nums := []int{}
	for _, a := range A {
		if cnts[a] == 0 {
			nums = append(nums, a)
		}
		cnts[a]++
	}

	var ok bool
	var x, y, z int
	switch len(nums) {
	case 1:
		ok = (nums[0] == 0)
	case 2:
		x, z = nums[0], nums[1]
		if z != 0 {
			z, x = x, z
			if z != 0 {
				fmt.Println("No")
				return
			}
		}
		ok = (cnts[0]*2 == cnts[x])
	case 3:
		x, y, z = nums[0], nums[1], nums[2]
		ok = (x^y == z && cnts[x] == cnts[y] && cnts[y] == cnts[z])
	default:
		fmt.Println("No")
		return
	}

	if ok {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func init() {
	_sw.Split(bufio.ScanWords)
}

func NextInt() int {
	if _sw.Scan() == false {
		panic(_sw.Err())
	}
	i, e := strconv.Atoi(_sw.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func NextInts(n int) []int {
	a := make([]int, n)
	for i := range a {
		a[i] = NextInt()
	}
	return a
}

func NextString() string {
	if _sw.Scan() == false {
		panic(_sw.Err())
	}
	return _sw.Text()
}

func Max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func Min(x, y int) int {
	if x > y {
		return y
	}
	return x
}

func Bounded(lower, n, upper int) int {
	return Min(upper, Max(lower, n))
}

func SortInts(xs []int) {
	sort.Sort(sort.IntSlice(xs))
}

func ReverseSortInts(xs []int) {
	sort.Sort(sort.Reverse(sort.IntSlice(xs)))
}
