package main

import "fmt"

func check(cntr map[int]int, n int) bool {
	for _, v := range cntr {
		if v*3 != n {
			return false
		}
	}
	return true
}
func check2(cntr map[int]int, n int) bool {
	for _, v := range cntr {
		if v*2 != n {
			return false
		}
	}
	return true
}

func main() {
	var n int
	fmt.Scan(&n)
	xs := make([]int, n)
	for i := range xs {
		fmt.Scan(&xs[i])
	}

	counter := make(map[int]int)
	for _, x := range xs {
		counter[x]++
	}

	if len(counter) == 3 {
		if n%3 != 0 || !check(counter, n) {
			fmt.Println("No")
		} else {
			vs := make([]int, 0)
			for k := range counter {
				vs = append(vs, k)
			}
			if vs[0]^vs[1] == vs[2] {
				fmt.Println("Yes")
			} else {
				fmt.Println("No")
			}
		}
	} else if len(counter) == 2 {
		vs := make([]int, 0)
		for k := range counter {
			vs = append(vs, k)
		}
		if vs[0] == 0 || vs[1] == 0 {
			nzero := 0
			if vs[0] == 0 {
				nzero = vs[1]
			} else {
				nzero = vs[0]
			}
			if (counter[nzero] >= counter[0] && counter[nzero] <= 2*counter[0]) || counter[0] >= counter[nzero] {
				fmt.Println("Yes")
			} else {
				fmt.Println("No")
			}
		} else {
			fmt.Println("No")
		}
	} else if len(counter) == 1 {
		if counter[0] > 0 {
			fmt.Println("Yes")
		} else {
			fmt.Println("No")
		}
	} else {
		fmt.Println("No")
	}
}
