package main

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

var sc = bufio.NewScanner(os.Stdin)

func init() {
	const maxWord = (1 << 30)
	buf := []byte{}
	sc.Buffer(buf, maxWord)
	sc.Split(bufio.ScanWords)
}

func input() string {
	sc.Scan()
	return sc.Text()
}

func solve(n int, a []int) string {
	m := map[int]int{}
	for _, v := range a {
		m[v]++
	}

	if m[0] == n {
		return "Yes"
	}
	if n%3 != 0 {
		return "No"
	}

	if len(m) == 2 {
		if m[0] == (n / 3) {
			return "Yes"
		} else {
			return "No"
		}
	}

	if len(m) == 3 {
		nums := make([]int, 0, 3)
		for k, _ := range m {
			nums = append(nums, k)
		}
		if nums[0]^nums[1] == nums[2] {
			return "Yes"
		}
	}

	return "No"
}

func main() {
	n, _ := strconv.Atoi(input())
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i], _ = strconv.Atoi(input())
	}
	fmt.Println(solve(n, a))
}
