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 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 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")
		}
	}
}
